Question: . Tracking Grades A teacher wants a program to keep track of grades for students and decides to create a student class for his program
. Tracking Grades A teacher wants a program to keep track of grades for students and decides to create a student class for his program as follows . Each student will be described by three pieces of data: his/her name, his/her score on test # 1, and hisher score on test#2. There will be one constructor, which will have one argument-the name ofthe student There will be three methods: getName, which will return the student's name inputGrades, which will prompt for and read in the student's test grades; and getAverage, which will compute and return the student's average File Student.java contains an incomplete definition for the Student class. Save it to your directory and complete the class definition as follows a. Declare the instance data (name, score for testl, and score for test2) b. Create a Scanner object for reading in the scores. c. Add the missing method headers d. Add the missing method bodies. File Grades java contains a shell program that declares two Student objects. Save it to your directory and use the inputGrades method to read in each student s test scores, then use the getAverage method to find their average. Print the average with the student's name, eg. The average for Joe is 87. You can use the get Name method to print the student's name. 3. Add statements to your Grades program that print the values of your Student objects directly, e.g: System.out printin("Student 1: + studentl) This should compile, but notice what it does when you run it nothing very useful! When an object is printed, Java looks for a roString method for that object. This method must have no
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
