app 1 – Creates 1 student objec student 2 – For Loop First name Using the student object , get the semester GPA Last name Display student name and

app 1 – Creates 1 student objec student 2 – For Loop First name Using the student object , get the semester GPA Last name Display student name and. {         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.
  • Have this method generate the GPA randomly in a range between 0 and 4.0.
  • Implement a for loop in the application to call for the student’s GPA 8 times.
  • Display a number to account for the semester (from 1 to 8) and the student’s name and GPA for each semester
  • At the end update the student’s attribute GPA and display the student’s name and the final GPA (the average of the 8 semesters).
  • Do not add any new attributes or variables to the student class.
  • The only change to the student class should be the addition of the new method.

For instance, a report could look like this:

Semester 1 – John’s GPA is 3.5

Semester 2 – John’s GPA is 2.0

Semester 3 – John’s GPA is 4.0

………………………………….

Semester 8 – John’s GPA is 3.0

___________________________

John’s average GPA is 3.2

Suggestions 

1 – Start with your assignment 01. The new method semesterGPA() is one more method in the student class. The student class should still have everything as in the last assignment.

2 – Create a method called semesterGPA() in the student class. This method is going to return a random value between 0.0 and 4.0. Every time the method is called, it calculates a new random number and returns it.

3 – Change the app.

  • App doesn’t need the if statements from assignment 01
  • App doesn’t need 3 students as in assignment 01. This time you need only one student object.
  • Include a for loop for the interaction through the 8 semesters.
  • In the for loop display the student’s name and semesterGPA
  • Start accumulating data to calculate later the average GPA
  • After the for loop,
  • Calculate the average GPA
  • Update the student GPA attribute with the calculated average GPA
  • Display the student average GPA using the student GPA attribute

{     () {                        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

app 1 – Creates 1 student objec student 2 – For Loop First name Using the student object , get the semester GPA Last name Display student name and