-
Notifications
You must be signed in to change notification settings - Fork 0
/
Marks2Grade.java
35 lines (28 loc) · 1.1 KB
/
Marks2Grade.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
import java.util.*;
public class Marks2Grade {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int input;
int marks;
do {
System.out.println("Please enter 1 to Continue or 0 to Exit");
input = sc.nextInt();
if (input == 1) {
System.out.print("Enter marks (out of 100)= ");
marks = sc.nextInt();
if (marks <= 100 && marks >= 90) {
System.out.println("\nThis is Good\n");
} else if (marks <= 89 && marks >= 60) {
System.out.println("\nThis is also Good\n");
} else if (marks <= 59 && marks >= 0) {
System.out.println("\nThis is Good as well\n");
} else {
System.out.println("\nInvalid marks. \n \tPlease enter marks between 0 and 100.\n");
}
System.out.println(" \t \t _______________\n");
}
} while (input == 1);
System.out.println("\nThank you\n");
sc.close();
}
}