IN JAVA Create the following classes The Transcript class is
IN JAVA
Create the following classes:
The Transcript class is designed to hold information on all the courses a student has taken. As such you
 will need to find a way to an unknown number of CourseRecord objects within each Transcript object.
 The Transcript object is also responsible for calculating the student’s GPA. GPA is calculated as the sum
 of the grade points for each course, divided by the total number of credits.
 Transcript Class API                                                                     Method Header Notes
 public Transcript( String name )    Constructor takes arguments specifying a student’s name.
 public String getName()                                    Returns the student’s name.
 public void addCourse(String
 number, String name, int credits,
 char grade)                                                      Creates and stores a CourseRecord object in this Transcript.
 public double getGPA()                                     Returns the student’s GPA.
 public String toString()                                       Returns a String containing the student\'s name on one line, the
                                                                         student’s GPA on the next line and each CourseRecord object
                                                                         stored in this Transcript object on its own line after that
The RecordSystem class is designed to hold the Transcripts for all students at an institution. As such you
 will need to find a way to an unknown number of Transcript objects within each RecordSystem object.
 As implemented here, the RecordSystem object has minimal functionality (feel free to add more, as long
 as you do not break the core requirements. Note that the individual Transcript objects stored in the
 RecordSystem object will be accessed using the getStudent( int index ) method.
RecordSystem Class API Method Header Notes
public RecordSystem()         Default constructor.
 public int addStudent( String name )            Creates and stores a Transcript object in this RecordSystem.
                                                             Returns an int corresponding to the index where the Transcript
                                                                was stored.
 public Transcript getStudent( int index )         Returns a reference to the Transcript object stored at location
                                                                   “index”
 public int maxGPAindex()                        Returns the index of the Transcript object that has the highest
                                                              GPA.
 public int maxGPA()    Returns the GPA of the Transcript object that has the highest
                                                           GPA.
 public int maxGPAname()                       Returns the student name of the Transcript object that has the
                                                              highest GPA.
 public String toString() Returns a String containing all Transcript objects stored, each
                                                              separated by a divider of ‘*’s.
Solution
import java.util.Scanner;
public class StudentGPA {
public static void main (String args[]){
String grade = \"\";
double credit1;
double credit2;
double credit3;
double credit4;
double gradeValue=0;
double totPtsClass1=0;
double totPtsClass2=0;
double totPtsClass3=0;
double totPtsClass4=0;
double totPts=0;
double totalCredits= 0;
double gpa;
Scanner console = new Scanner (System.in);
System.out.println(\"Please enter the number of credits of the class 1 (A number)\");
credit1 = console.nextDouble();
System.out.println(\"Please enter your grades for the class 1(Capital letters such as A,B+, C-)\");
grade = console.next();
if (grade.equals (\"A\"))
gradeValue= 4.00;
else if (grade.equals(\"A-\"))
gradeValue= 3.67;
else if (grade.equals(\"B+\"))
gradeValue = 3.33;
else if (grade.equals(\"B\"))
gradeValue = 3.00;
else if (grade.equals (\"B-\"))
gradeValue = 2.67;
else if (grade.equals(\"C+\"))
gradeValue = 2.33;
else if (grade.equals(\"C\"))
gradeValue = 2.00;
else if (grade.equals (\"D+\"))
gradeValue = 1.33;
else if (grade.equals (\"D\"))
gradeValue = 1.00;
else if (grade.equals (\"F\"))
gradeValue = 0;
else if (grade.equals (\"FX\"))
gradeValue = 0;
else
System.out.println (\"Invalid Grade\");
totPtsClass1 = gradeValue * credit1;
System.out.println(\"Please enter the number of credits of the class 2 (A number)\");
credit2 = console.nextDouble();
System.out.println(\"Please enter your grades for the class 2 (Capital letters such as A,B+, C-)\");
grade = console.next();
if (grade.equals (\"A\"))
gradeValue= 4.00;
else if (grade.equals(\"A-\"))
gradeValue= 3.67;
else if (grade.equals(\"B+\"))
gradeValue = 3.33;
else if (grade.equals(\"B\"))
gradeValue = 3.00;
else if (grade.equals (\"B-\"))
gradeValue = 2.67;
else if (grade.equals(\"C+\"))
gradeValue = 2.33;
else if (grade.equals(\"C\"))
gradeValue = 2.00;
else if (grade.equals (\"D+\"))
gradeValue = 1.33;
else if (grade.equals (\"D\"))
gradeValue = 1.00;
else if (grade.equals (\"F\"))
gradeValue = 0;
else if (grade.equals (\"FX\"))
gradeValue = 0;
else
System.out.println (\"Invalid Grade\");
totPtsClass2 = gradeValue * credit2;
System.out.println(\"Please enter the number of credits of the class 3 (A number)\");
credit3 = console.nextDouble();
System.out.println(\"Please enter your grades for the class 3 (Capital letters such as A,B+, C-)\");
grade = console.next();
if (grade.equals (\"A\"))
gradeValue= 4.00;
else if (grade.equals(\"A-\"))
gradeValue= 3.67;
else if (grade.equals(\"B+\"))
gradeValue = 3.33;
else if (grade.equals(\"B\"))
gradeValue = 3.00;
else if (grade.equals (\"B-\"))
gradeValue = 2.67;
else if (grade.equals(\"C+\"))
gradeValue = 2.33;
else if (grade.equals(\"C\"))
gradeValue = 2.00;
else if (grade.equals (\"D+\"))
gradeValue = 1.33;
else if (grade.equals (\"D\"))
gradeValue = 1.00;
else if (grade.equals (\"F\"))
gradeValue = 0;
else if (grade.equals (\"FX\"))
gradeValue = 0;
else
System.out.println (\"Invalid Grade\");
totPtsClass3 = gradeValue * credit3;
System.out.println(\"Please enter the number of credits of the class 4 (A number)\");
credit4 = console.nextDouble();
System.out.println(\"Please enter your grades for the class 4 (Capital letters such as A,B+, C-)\");
grade = console.next();
if (grade.equals (\"A\"))
gradeValue= 4.00;
else if (grade.equals(\"A-\"))
gradeValue= 3.67;
else if (grade.equals(\"B+\"))
gradeValue = 3.33;
else if (grade.equals(\"B\"))
gradeValue = 3.00;
else if (grade.equals (\"B-\"))
gradeValue = 2.67;
else if (grade.equals(\"C+\"))
gradeValue = 2.33;
else if (grade.equals(\"C\"))
gradeValue = 2.00;
else if (grade.equals (\"D+\"))
gradeValue = 1.33;
else if (grade.equals (\"D\"))
gradeValue = 1.00;
else if (grade.equals (\"F\"))
gradeValue = 0;
else if (grade.equals (\"FX\"))
gradeValue = 0;
else
System.out.println (\"Invalid Grade\");
totPtsClass4 = gradeValue * credit4;
totPts= totPtsClass1+totPtsClass2+totPtsClass3+totPtsClass4;
totalCredits = credit1+credit2+credit3+credit4;
gpa= totPts / totalCredits;
System.out.printf(\"Your GPA is: %.2f\ \", + gpa);
}
}





