-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExample2.java
More file actions
37 lines (36 loc) · 1.29 KB
/
Example2.java
File metadata and controls
37 lines (36 loc) · 1.29 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
import java.util.Scanner;
public class Example2 {
// hafta kuni butun son berilgan
// shu songa mos bo'lgan hafta kuni nomi chop etilsin
// 5 -> juma
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int weekInt = scanner.nextInt();
String weekText = "";
if (weekInt == 1) {
weekText = "Dushanba";
System.out.println("dushanbalik ishlar");
} else if (weekInt == 2) {
weekText = "Seshanba";
System.out.println("seshanbalik ishlar");
} else if (weekInt == 3) {
weekText = "chorshanba";
System.out.println("chorshanbalik ishlar");
} else if (weekInt == 4) {
weekText = "payshanba";
System.out.println("payshanbalik ishlar");
} else if (weekInt == 5) {
weekText = "juma";
System.out.println("jumalik ishlar");
} else if (weekInt == 6) {
weekText = "shanba";
System.out.println("shanbalik ishlar");
} else if (weekInt == 7) {
weekText = "yakshanba";
System.out.println("yakshanbalik ishlar");
} else {
System.out.println("Bunday hafta kuni mavjud emas");
}
System.out.println(weekText);
}
}