-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThe_Switch_Statement.java
More file actions
50 lines (45 loc) · 1.12 KB
/
The_Switch_Statement.java
File metadata and controls
50 lines (45 loc) · 1.12 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.util.Scanner;
public class The_Switch_Statement {
public static void main(String[] args){
//The Switch Statement
//Question : Grading of Student
Scanner scan = new Scanner(System.in);
System.out.println("Enter Your RollNumber From 1 to 10");
int rollNumber = scan.nextInt();
switch (rollNumber){
case 1:
System.out.println("Honours");
break;
case 2:
System.out.println("I Division");
break;
case 3:
System.out.println("II Division");
break;
case 4:
System.out.println("III Division");
break;
case 5:
System.out.println("IV Division");
break;
case 6:
System.out.println("V Division");
break;
case 7:
System.out.println("VI Division");
break;
case 8:
System.out.println("VII Division");
break;
case 9:
System.out.println("VIII Divison");
break;
case 10:
System.out.println(" XI Division");
break;
default:
System.out.println("FAIL");
break;
}
}
}