SOLVED: Create a package named cs520.hw5

29.99 $ 15.00 $

Create a class named Student as follows. The class keeps track of the student’s homework grades. This is a modification of HW4 using arrays.
The instance (or member) private variables – name (String), homeworks (an integer array).
A static public integer variable, NUM_HOMEWORKS, initialized to 6.
A single constructor with name as its argument. Also, allocate the space for the homeworks array to hold NUM_HOMEWORKS values

Category:

Description

Create a package named cs520.hw5 Solution
Create a package named cs520.hw5. Using this package, create the following classes.

Create a class named Student as follows. The class keeps track of the student’s homework grades. This is a modification of HW4 using arrays.
The instance (or member) private variables – name (String), homeworks (an integer array).
A static public integer variable, NUM_HOMEWORKS, initialized to 6.
A single constructor with name as its argument. Also, allocate the space for the homeworks array to hold NUM_HOMEWORKS values
The public get and set methods for the name instance variable.
A void setHomeworkGrade method which takes two arguments – a zero based index of the homework and the corresponding homework grade. In the body of the method, store the homework grade into the corresponding array location.
A public computeAverage method which takes no arguments and returns a double showing the average homework grade for this student. You should use a for loop to add the homework grades and then compute the average. This code should be independent of the length of the homework array.
Override the toString method to return the string representation of this object in the format “The