Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Computer Network questions