-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasics5.java
More file actions
29 lines (22 loc) · 762 Bytes
/
basics5.java
File metadata and controls
29 lines (22 loc) · 762 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
package irene;
import java.util.Scanner;
public class basics5 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your marks (0 to 100): ");
double marks = scanner.nextDouble();
if (marks >= 90 && marks <= 100) {
System.out.println("Your grade is: A");
} else if (marks >= 75) {
System.out.println("Your grade is: B");
} else if (marks >= 60) {
System.out.println("Your grade is: C");
} else if (marks >= 40) {
System.out.println("Your grade is: D");
}
else {
System.out.println("Invalid marks entered.");
}
scanner.close();
}
}