Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(30 Pts) Write a class called Student. The class must have two fields: name of the String type and gpa of the double type.
(30 Pts) Write a class called Student. The class must have two fields: name of the String type and gpa of the double type. Write all the necessary constructors, getters, setters, and toString() methods. Now create another class called StudentBag. This class will allow you to store up to 1000 student objects in an array. The class should also have insert(Student student), removeByName(String name), findByName(String name), and display() methods. The display() method will only display the objects that are in the bag. Write a Demo class to demonstrate your StudentBag class by (1) inserting 5 students, (2) finding the second one, (3) removing the fourth one, and (4) displaying the remaining students in the bag.
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