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 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
Get step-by-step solutions from verified subject matter experts
