Question: ISTE-120 Lab 05: Implementing Classes & Data Types Exercise 1-Implementing a class and tester (10 points) The exercise must be completed during the lab period

 ISTE-120 Lab 05: Implementing Classes & Data Types Exercise 1-Implementing a
class and tester (10 points) The exercise must be completed during the

ISTE-120 Lab 05: Implementing Classes & Data Types Exercise 1-Implementing a class and tester (10 points) The exercise must be completed during the lab period wnte a simple class grade report program. This will work for a class of exactly three students (quite a limitation). Write a class to represent the student's record. This class (named Student) should have a constructor to which we will pass the student's name (String) and id number (int). It will have attributes for these two values, plus two other attributes which we could call sumGrades and numGrades, both ints and both initialized to zero. Besides the constructor, write a method public void addGrade (int newGrade) which will add the grade to sumGrades and will also add 1 to numGrades. Also, write a method public double getAverage () which calculates the student's average (this is the sum of the grades divided by the number of grades integer division here). .beware of Finally, write a toString method in this class: public String tostring () which will return a string formatted as follows: ame That's 10 characters for the name (exactly, no overflow), left justified, then a space, then 5 characters for the id right justified, then a space, then 7 Characters for the grade (right justified) with 2 spaces to the right of the decimal point. Use String.format in this method. Now, write another class named (the Tester) Report3. The main program is here and will follow the following input/output script: studentl: Name: Fred Smith ID: 12345 Gradel: 8o Grade2: 70 Grade3: 80 Student2: Name: Martha Stewart ID: 54321 Gradel: 90 Grade2: 60 Grade3: 75 Student3: Page 1 of 2

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