Write a java program that translates a letter grade into a


Write a Java program that translates a letter grade into a number grade. Letter grades are A B C D F, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F-. A + increases the numeric value by 0.3, a - decreases it by 0.3. However, an A+ has the value 4.0. All other inputs have value -1.

A sample session could look like following.

Enter a letter grade:
B-
Numeric value: 2.7.

Write a class Grade with a method getNumericGrade.

Use the following class as your main class:

import java.util.Scanner;

/**
This class prints the numeric value of a letter grade given by the user.
*/
public class GradePrinter
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Enter a letter grade:");
String input = in.nextLine();
Grade g = new Grade(input);
double grade = g.getNumericGrade();
System.out.println("Numeric value: " + grade);
}
}

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a java program that translates a letter grade into a
Reference No:- TGS01249872

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)