forked from akash-coded/core-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuDriven.java
More file actions
23 lines (22 loc) · 731 Bytes
/
MenuDriven.java
File metadata and controls
23 lines (22 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class MenuDriven {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Choose one of the given options[1-3]::");
int input = sc.nextInt();
switch (input) {
case 1:
System.out.println("You have chosen addition");
break;
case 2:
System.out.println("You have chosen subtraction");
break;
case 3:
System.out.println("You have chosen to exit. Goodbye!");
break;
default:
System.out.println("Invalid option. Goodbye!");
break;
}
}
}