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:

  1. prompts the user for the number of students.
  2. prompts the user for the numeric average for each student.
  3. 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) {

  4. outputs the String returned by the calculateGrade() method

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!