Help me with this code Create a “Grades” class with the following API Constructo
ID: 3914331 • Letter: H
Question
Help me with this code
Create a “Grades” class with the following API
Constructor
Grades
(int studentCount, int min_grade, int max_grade)
This will create an array of student grades. Each grade will be a random number from min_grade to max_grade, inclusive.
Methods
1) toString() prints the grades in this format: grades: [78, 58, 76, 101, 59, 55, 84, 91, 84, 67]
2) An accessor and a multator for a grade
3) An equals method
4) A clone method
5) A method that sorts the grades in ascending order
6) A method that sorts the grades in descending order
7) A method that returns the highest grades
8) A method that returns the average grade to one decimal place.
9) A method that returns the median grade
10 ) A method that returns the modes
11 ) A method that returns an Array containing the number of F’s D’s C’s B’s and A’s [7, 2, 1, 0, 0]
12 ) A method that returns an Array containing each student’s letter grade [F, F, D, F, F, C, F, F, D, F]
13 ) The standard deviation of the grades to one decimal place
how many students?
10
min grade:
0
max grade:
100
grades: [59, 1, 70, 1, 30, 7, 48, 100, 45, 83]
sorted grades: [1, 1, 7, 30, 45, 48, 59, 70, 83, 100]
reverse grades: [100, 83, 70, 59, 48, 45, 30, 7, 1, 1]
The highest grade is: 100
Average grade: 44.4
Median grade: 46
Modes [1]
Letter grades: [7, 0, 1, 1, 1]
[F, F, C, F, F, F, F, A, F, B]
SD: 32.9
Cloned grades are equal
grade to change:
1
new grade:
100
grades: [59, 100, 70, 1, 30, 7, 48, 100, 45, 83]
Changed grades are not equal
how many students?
p
how many students?
-1
how many students?
0
how many students?
11
min grade:
105
max grade:
50
grades: [56, 59, 92, 94, 80, 55, 103, 101, 78, 51, 69]
sorted grades: [51, 55, 56, 59, 69, 78, 80, 92, 94, 101, 103]
reverse grades: [103, 101, 94, 92, 80, 78, 69, 59, 56, 55, 51]
The highest grade is: 103
Average grade: 76.2
Median grade: 78
Modes [51, 55, 56, 59, 69, 78, 80, 92, 94, 101, 103]
Letter grades: [4, 1, 1, 1, 4]
[F, F, A, A, B, F, A, A, C, F, D]
SD: 18.5
Cloned grades are equal
grade to change:
9
new grade:
100
grades: [56, 59, 92, 94, 80, 55, 103, 101, 78, 100, 69]
Changed grades are not equal
Explanation / Answer
You should be able to write main method using the above methods, as due to the lack of time, i can not give you the main method. hope you understand! thanks!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.