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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, paigesyring
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
image
Computers and Technology, 23.06.2019 08:30, Bradgarner772
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
image
Computers and Technology, 24.06.2019 18:20, mshepherdmiller
Acommon algorithm for converting a decimal number to binary is to repeatedly divide the decimal number by 2 and save the remainder. this division is continued until the result is zero. then, each of the remainders that have been saved are used to construct the binary number. write a recursive java method that implements this algorithm. it will accept a value of int and return a string with the appropriate binary character representation of the decimal number. my code: public class lab16{public string converttobinary(int input){int a; if(input > 0){a = input % 2; return (converttobinary(input / 2) + "" +a); } return ""; } }
Answers: 1
image
Computers and Technology, 24.06.2019 22:30, yaretxi
Telling a computer that is already on to turn again is known as what type of boot?
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 in other subjects:

Konu
Mathematics, 25.08.2019 18:50