subject

You must implement and complete the class Bundle. You may and are encouraged to use classes ItemInfo and Items. There is a constant instance of the Items class, named ALL_ITEMS. You WILL want to use this. You do not have to worry about Bundle being integrated into the existing inventory system as that is the responsibility of your partner. While you can alter the classes ItemInfo, Items, and the constant ALL_ITEMS, you should not as the test cases use files completely independent of the ones provided to you. In this problem, you must successfully add and remove a given amount of a specific item to and from the bundle and return a boolean representing whether the action could occur. Recall that a bundle can only hold a single stack of items. Thankfully, the original Minecraft game developers were nerds and set the precedent of all stack sizes being powers of 2 (i. e. 2^0, 2^3, 2^5) with a max stack size of 64 (2^5) and a min stack size of 1 (2^0). The developers who hired you are leaving the exact implementation up to you with the only restrictions being the runtime of your algorithms. Modify the following functions in the class Bundleclass Bundle:__init__(self) -> None:This is currently empty, but you are allowed to create new attributes to help you store the items in the bundle (you will have to).DO NOT create any more parameters. i. e. Do not change the definition of __init__ from __init__(self) to __init__(self, someList, someString). You will fail the tests this way. Return: Noneto_set(self) -> Set[Tuple[str, int]]Converts the bundle to a set of tuples where the first index in the tuple is the item name and the second index is the amount of that item in the bundle. The order DOES NOT MATTER as this is a set where no order is given, this function is purely for test cases for us to see if you correctly added/removed an item to/from the bundleIf you do not implement this function, you WILL fail all your tests

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:40
5. illustrate how fine-line inventory classification can be used with product and market segments. what are the benefits and considerations when classifying inventory by product, market, and product/market?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What is the term for water wave that is created by an underwater earthquake
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
You know the right answer?
You must implement and complete the class Bundle. You may and are encouraged to use classes ItemInfo...
Questions
question
Mathematics, 18.03.2021 02:10
question
Arts, 18.03.2021 02:10
question
Mathematics, 18.03.2021 02:10
question
Mathematics, 18.03.2021 02:10
question
History, 18.03.2021 02:10
Questions on the website: 13722362