Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. Remember, while a Bag can hold any type of object, for the purposes of this assignment, your bag will be storing GymEquipment objects. [20
2. Remember, while a Bag can hold any type of object, for the purposes of this assignment, your bag will be storing GymEquipment objects. [20 pts] (a) Using the ArrayBagTest class created in the previous assignment, create GymEquipments objects as asked below. In that class you should have implemented methods in the Bag interface as discussed in the class and in the Textbook: i. Create a mix of CardioMachine and FreeWeightMachine objects and add to the bag. The bag must contain at least 4 GymEquipment type objects ii. Print bag contents p2 Feb 18, 2023 Hint: You will need to define print method in the MyArrayBag class that in turn will print data for each GymEquipment object contained in the bag. Sample output: iii. Remove gym object(s), using both remove methods defined in the interface iv. Print bag size before and after an GymEquipment objectremoval v. Pick an arbitrary dollar amount to print all GymEquipment objects with balance greater than that amount vi. Since a Bag can have duplicate items, be sure to have at least one duplicate GymEquipment object in the bag - [how do you plan to do that]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started