-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrades.java
More file actions
28 lines (24 loc) · 848 Bytes
/
Grades.java
File metadata and controls
28 lines (24 loc) · 848 Bytes
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
import java.util.Scanner;
public class Grades{
public static void main(String [] args){
Scanner grades = new Scanner(System.in);
int x = 0;
System.out.print("What is the percentage of the student: ");
x = grades.nextInt();
if (x <= 92 && x >= 100)
System.out.print("A");
else if (x >= 87 && x <= 91)
System.out.print("B+");
else if (x >= 83 && x <= 86)
System.out.print("B");
else if (x >= 79 && x <= 82)
System.out.print("C+");
else if (x >= 75 && x <= 78)
System.out.print("C");
else if (x >= 70 && x <= 74)
System.out.print("D");
else if (x <70)
System.out.print("F");
// so on and so forth down the grading scale
}
}