Question: Define an adapter class, BuildBag, that will act as the test class, whose main() method will contain the code to perform testing. The method should

 Define an adapter class, BuildBag, that will act as the test

Define an adapter class, BuildBag, that will act as the test class, whose main() method will contain the code to perform testing. The method should do the following [20 points] Along the lines of testing with GymEquipment objects for the array-based bag, do the following to test your LinkedBag (a) Create 2 CardioMachine and 2 FreeWeightMachine objects, with appropriate data. The data required to create the gym objects can be hard-coded in the main() method (b) Instantiate your LinkedBag class, using the appropriate constructor(s) (c) Add the 4 gym objects created in (a) to the LinkedBag object, using the add() method (d) Remove an GymEquipment object from the bag (e) Print bag contents (details for each GymEquipment type of object) in the console

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!