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, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
question
Computers and Technology, 24.06.2019 10:50
In 2009 to 2010, how many social network users were reported as being victims of online abuse? a. 1 in 10 b. 100% c.1 in 100 d. 50%
Answers: 2
question
Computers and Technology, 24.06.2019 12:00
How can we take picture in this app
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior
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