Question: Create a user-defined class called Student . Each Player object will have the following attributes (instance variables): name, ID , and GPA . Use appropriate

Create a user-defined class called Student. Each Player object will have the following attributes (instance variables): name, ID, and GPA. Use appropriate data types to define these instance variables and use recommended naming conventions for the variable names. Provide a constructor, implement the accessor and mutator methods for each of the instance variables, and include the toString( ) and equals( ) methods. Also include a static factory method that can be used to generate instances of the Student class. This method should create a student with a random name, ID, and GPA and return that student object.

Finally, create a Client Program BagClient with the main( ) method. Inside the main method do the following:

Create an object of ArrayBag called course1 to store information about 17 different students. Create an object of LinkedBag called course2 to store information about 14 different students.

Run a for loop to call the static factory method of the Student class to generate student objects to store in the bags.

Remove a random student from each course.

Add a new Student with some made up information to each team. You should read this in using the Scanner class.

Display the current count of students in each course.

Remove the Student that you just added earlier with made up information from each course using appropriate method.

Display the current count of students in each course.

Use a for loop (or implement the toString method for each of your Bag classes) to print the information of the Students in each course.

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!