Your goal is to implement the following three methods. sample output:
1. countStudentsByName(). This method will print out each unique name in the database
as well as the number of students with that name.
2. findStudentByID(int id). This method will print out the student (if they exist) who
has the id number that was passed as an input parameter.
3. printStudentsByGPA(). This will print out each unique gpa value in the database as
well as the list of students that have that GPA.
After you have completed those methods, modify the main method in the Main class to
test them. There are some unique rules for this lab, because I want to make sure you use
HashMaps and HashSets. They are:
You may not write any code outside of the methods I have already started for you
and the main method in the Main class. I.e., You may not make any more instance
variables or change how a student is added to the database. Do all of your work locally,
in the method you are building.
You may not use any arrays, ArrayLists, LinkedLists, or any other data structures be-
yond HashMaps and HashSets. All you need are loops, if statements, and HashMaps/HashSets.
——————————————————————————–
The countStudentsByName() method is correct
The findStudentByID(int id) method is correct
The printStudentsByGPA() method is correct
The main method was modified to reflect adequate testing
Sample output showing a Student database and the three methods you need to build:
Joe Schmo: (ID=1101), (gpa=3.2)
Joe Schmo: (ID=99999), (gpa=4.0)
Katie Katerson: (ID=31415926), (gpa=3.7)
Lizzie: (ID=88888), (gpa=3.7)
Watson TheBassetHound: (ID=12345), (gpa=2.4)
Joe Schmo: 2
Katie Katerson: 1
Lizzie: 1
Watson TheBassetHound: 1
4.0:
Joe Schmo, 99999
2.4:
Watson TheBassetHound, 12345
3.2:
Joe Schmo, 1101
3.7:
Lizzie, 88888
Katie Katerson, 31415926
Watson TheBassetHound: (ID=12345), (gpa=2.4)