-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHwMenudrivenProgram.java
More file actions
37 lines (28 loc) · 1001 Bytes
/
Copy pathHwMenudrivenProgram.java
File metadata and controls
37 lines (28 loc) · 1001 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
29
30
31
32
33
34
35
36
import java.util.Scanner;
public class HwMenudrivenProgram {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int choice;
int marks;
do {
System.out.println("Enter 1 to enter marks");
System.out.println("Enter 0 to stop");
choice = sc.nextInt();
if (choice == 1) {
System.out.print("Enter marks (0-100): ");
marks = sc.nextInt();
if (marks >= 90) {
System.out.println("This is Good");
} else if (marks >= 60) {
System.out.println("This is also Good");
} else if (marks >= 0) {
System.out.println("This is Good as well");
} else {
System.out.println("Invalid Marks");
}
}
} while (choice != 0);
System.out.println("Program Ended");
sc.close();
}
}