Question: Write a program called GradeCalculator that allows the user to enter numeric grade averages for a given number of students and outputs their letter grades
Write a program called GradeCalculator that allows the user to enter numeric grade averages for a given number of students and outputs their letter grades as shown below, using 90, 80, 70, 60 for the cutoffs for A, B, C, D. Use class constants for these cutoff values (do not use magic numbers).
Sample program execution:
csc$ java GradeCalculator
Enter number of students: 4
Enter average for student 1: 35 Grade for student 1: F
Enter average for student 2: 98 Grade for student 2: A
Enter average for student 3: 75.5 Grade for student 3: C
Enter average for student 4: 86 Grade for student 4: B
The program should have a main method that:
- prompts the user for the number of students.
- prompts the user for the numeric average for each student.
- calls the method below passing it the average entered by the user. This method should return the students letter grade as a String:
public static String calculateGrade(double Average) {
-
outputs the String returned by the calculateGrade() method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
