-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwitchCase.java
More file actions
36 lines (34 loc) · 1.1 KB
/
SwitchCase.java
File metadata and controls
36 lines (34 loc) · 1.1 KB
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 SwitchCase {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int empID = sc.nextInt();
String department = sc.next();
switch (empID) {
case 1:
System.out.println("Emp1");
break;
case 2:
System.out.println("Emp2");
break;
case 3:
System.out.println("Emp3");
switch (department) {
case "IT":
System.out.println("IT Department");
break;
case "CSE":
System.out.println("CSE Department");
break;
case "ECE":
System.out.println("ECE Department");
break;
default:
System.out.println("No Department entered");
}
break;
default:
System.out.println("Enter correct EmpID");
}
}
}