-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path19 Grading.java
More file actions
22 lines (20 loc) · 775 Bytes
/
Copy path19 Grading.java
File metadata and controls
22 lines (20 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.Scanner;
class Grading {
public static void main(String[] args) {
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("Great, You have got A");
} else if (percentage >= 75) {
System.out.println("Good, You have got B");
} else if (percentage >= 60) {
System.out.println("You have got C");
} else if (percentage >= 30) {
System.out.println("You have got D");
} else {
System.out.println("Sorry, Yor are failed");
}
}
}