Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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