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

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

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!