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 09:30
After you present a proposal, the committee starts asking you questions, some beyond the strict focus of your proposal. they ask questions about implications in other fields and knowledge about other fields. you are asked to redo your proposal. what is most likely missing? breadth of material depth of material clarity of material details of material
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
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, 11.02.2021 01:20
question
Mathematics, 11.02.2021 01:20
Questions on the website: 13722361