-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGrade.java
More file actions
28 lines (23 loc) · 826 Bytes
/
Grade.java
File metadata and controls
28 lines (23 loc) · 826 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 grade {
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your score : ");
int score = scanner.nextInt();
// nested if
if(score >= 90)
System.out.println("A");
else
if(score >= 80)
System.out.println("B");
else
if(score >= 70)
System.out.println("C");
else
if(score >= 60)
System.out.println("D");
else
System.out.println("E");
}
}