{ String firstName; String lastName; age; gpa; ( _age, _gpa) { firstName = _firstName; lastName = _lastName; age = _age; gpa = _gpa; } () { gpa; } String () { String s = ; s += firstName + + lastName; s += + age + + gpa; s; }}
Using the same classes from the last assignment, app and student, create an application that tracks and displays the student’s GPA for 8 semesters.
Things to implement:
Create a method in the class student that returns the student’s GPA.
Suggestions
{ () { Student student1 = Student(, , , ); Student student2 = Student(, , , ); Student student3 = Student(, , , ); (student1.getGPA() >= student2.getGPA() && student1.getGPA() >= student3.getGPA()) { System..println( + student1); } () >= student1.getGPA() && student2.getGPA() >= student3.getGPA() ) { System..println( + student2); } () >= student1.getGPA() && student3.getGPA() >= student2.getGPA() ) { System..println( + student3); } (student1.getGPA() <= student2.getGPA() && student1.getGPA() <= student3.getGPA()) { System..println( + student1); } () <= student1.getGPA() && student2.getGPA() <= student3.getGPA() ) { System..println( + student2); } () <= student1.getGPA() && student3.getGPA() <= student2.getGPA() ) { System..println( + student3); } }}app1 - Creates 1 student objecstudent2 - For LoopFirst nameUsing the student object , getthe semester GPALast nameDisplay student name andAgesemesterGPAGPAAccumulate data forcalculating average GPA latergetinfo ( )semesterGPA ( )3 - Calculate the average GPA4 - update the student GPA attributewith the calculated average GPA5 - Display the student average GPAusing the student GPA attribute