-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathswitch15.java
More file actions
45 lines (37 loc) · 1.25 KB
/
switch15.java
File metadata and controls
45 lines (37 loc) · 1.25 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
package swichcase;
import java.util.Scanner;
public class switch15 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n;
int m;
System.out.print("Qiymat:");
n = scanner.nextInt();
System.out.print("Turi:");
m = scanner.nextInt();
switch (n) {
case 6 -> System.out.print("olti ");
case 7 -> System.out.print("Yetti ");
case 8 -> System.out.print("Sakkiz ");
case 9 -> System.out.print("To`qqiz ");
case 10 -> System.out.print("O`n ");
case 11 -> System.out.print("Vallet ");
case 12 -> System.out.print("Dama ");
case 13 -> System.out.print("Qirol ");
case 14 -> System.out.print("Tuz ");
default -> {
System.out.println("Bunday Qiymat Yo`q");
}
}
switch (m) {
case 1 -> System.out.print("G`isht\n");
case 2 -> System.out.print("Olma\n");
case 3 -> System.out.print("Chillak\n");
case 4 -> System.out.print("Qarg`a\n");
default -> {
System.out.println("Bunday Tur Yo`q");
break;
}
}
}
}