Question: 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,

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!