-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrading.java
More file actions
23 lines (21 loc) · 816 Bytes
/
Grading.java
File metadata and controls
23 lines (21 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class Grading {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
System.out.println("Welcome to Grade Calculator!\n");
System.out.print("Please enter your Percentage: ");
float percentage = input.nextFloat();
if (percentage >= 90) {
System.out.println("Grade: A");
} else if (percentage >= 75) {
System.out.println("Grade: B");
} else if (percentage >= 60) {
System.out.println("Grade: C");
} else if (percentage >= 40) {
System.out.println("Grade: D");
} else {
System.out.println("You are Fail");
}
}
}
}