-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grades.java
53 lines (43 loc) · 1.08 KB
/
Grades.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import java.util.Scanner;
public class Grades {
private static Object String;
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int Grades;
char A = 'A';
char B = 'B';
char C = 'C';
char D = 'D';
char F = 'F';
String ERROR;
System.out.println("Enter your grade:");
Scanner reader = new Scanner(System.in);
Grades = reader.nextInt();
if (Grades >= 90 && Grades <=100)
{
System.out.printf("You have earned the letter grade : A" );
}
else if (Grades >= 80 && Grades <= 89)
{
System.out.printf("You have earned the letter grade: B");
}
else if (Grades >=70 && Grades <= 79)
{
System.out.printf("You have earned the letter grade: C");
}
else if (Grades >= 60 && Grades <= 69)
{
System.out.printf("You have earned the letter grade: D");
}
else if (Grades >= 0 && Grades <= 59)
{
System.out.printf("You have earned the letter grade: F");
}
else
{
System.out.println("ERROR You have entered an invalid input");
}
{
}
}
}