Question: Assume that grades only include A, B, C, F and in progress and all courses have the same credits (one credit). Further assume that

 

 

Assume that grades only include "A", "B", "C", "F" and "in progress"

Assume that grades only include "A", "B", "C", "F" and "in progress" and all courses have the same credits (one credit). Further assume that grades are non- empty, and first-semester Students do not have any grade yet (all their current grades are "in progress." Signature of the class needs to be figured out and extra helper functions can be useful if needed. public class Student { final String name; final String ID; //ID is a String instead of integer final ArrayList Grades; //constructor public Student (String name, String ID, ArrayList Grades) { } public ArrayList getGrades () { } return Grades; public double getGPA () { //your implementation } 1. Implement the getGPA() method to compute the GPA of each Student. The numerical grades of "A", "B", "C", and "F" are 4,3,2, and 0 respectively. Do not count the courses "in progress" since grades are not assigned yet. For first- semester Students (all grades are in progress), return -1 2. Write a class Comparator GPAOrdering to sort Students in the descending order of GPA. If Students have the same GPA, further sort them in the ascending order of number of Fs that students have, i.e. Students with less Fs appear before Students with more Fs in ordering

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 Programming Questions!