Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

explain what is meant by experiential learning

Answered: 1 week ago

Question

identify the main ways in which you learn

Answered: 1 week ago