Question
5th Part to the question Create a client class named Client with the main( ) method. Inside the main method do the following: Create an
5th Part to the question
Create a client class named Client with the main( ) method. Inside the main method do the following:
Create an object of ArrayBag called MensTeam to store players information of LSUs Mens football team using the overload constructor to make the initial length of the list array equal to 2.
1. Add eight players to MensTeam by hardcoding eight calls to the add method (one for each player).
2. Display the contents of the Bag.
3. Remove a random player from the team.
4. Display the contents of the Bag.
5. Add another Player with another hardcoded add method call.
6. Display the contents of the Bag.
7. Remove the Player that you just added in 5.
8. Display the contents of the Bag.
9. To demonstrate that your generic class can support objects of different types:
a. Create an instance of a Bag called courses to store the course ids of the courses that you are taking this semester (CSCI 131, ..) as Strings.
b. Populate the Bag with each of your courses.
c. Display the contents of the Bag.
d. Remove a random course id from the Bag.
e. Display the contents of the Bag.
Create an instance of LinkedBag called WomensTeam to store the players information of LSUs Womens basketball team.
Repeat steps 1 through 8 above for the WomensTeam that uses LinkedBag
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