rooms){
Scanner scanner = new Scanner(System.in);
int number = scanner.nextInt();
for (int i = 0; i < list.get(number-1).get(rooms.get(number-1)).size(); i++) {
System.out.println(list.get(number-1).get(rooms.get(number-1)).get(i));
}
System.out.println("\tOrqaga qaytish uchun 0 ni kiriting");
System.out.println("\tDasturdan chiqish uchun boshqa sonni kiriting");
switch (scanner.nextInt()){
case 0: homeMenu(list, rooms);break;
default:
System.out.println("Dasturdan foydalanganligingiz uchun rahmat");
}
}
}
Output:
Xonalar sonini kiriting : 3
1 - xona nomerini kiriting : 201
201 - xona talabalari sonini kiriting : 3
1 - talaba familiyasini kiriting : Sheronov
2 - talaba familiyasini kiriting : Hoshimjonov
3 - talaba familiyasini kiriting : Hamroqulov
2 - xona nomerini kiriting : 202
202 - xona talabalari sonini kiriting : 3
1 - talaba familiyasini kiriting : Tursunboyev
2 - talaba familiyasini kiriting : Ergashov
3 - talaba familiyasini kiriting : Gulmamatov
3 - xona nomerini kiriting : 203
203 - xona talabalari sonini kiriting : 4
1 - talaba familiyasini kiriting : Zulfuqorov
2 - talaba familiyasini kiriting : Mavlonov
3 - talaba familiyasini kiriting : Alimov
4 - talaba familiyasini kiriting : Sobirov
TATU KIF Fakulteti yotoxonasidan talabalarni qidirish dasturiga xush kelibsiz!
Qanday ma'lumotni qidirmoqchisiz?
1. Xona raqami orqali talabalarni qidirish
1
Qaysi xonadan talabalarni qidirmoqchisiz :
1. 201
2. 202
3. 203
1
Sheronov
Hoshimjonov
Hamroqulov
Orqaga qaytish uchun 0 ni kiriting
Dasturdan chiqish uchun boshqa sonni kiriting
0
Qaysi xonadan talabalarni qidirmoqchisiz :
1. 201
2. 202
3. 203
2
Tursunboyev
Ergashov
Gulmamatov
Orqaga qaytish uchun 0 ni kiriting
Dasturdan chiqish uchun boshqa sonni kiriting
0
Qaysi xonadan talabalarni qidirmoqchisiz :
1. 201
2. 202
3. 203
3
Zulfuqorov
Mavlonov
Alimov
Sobirov
Orqaga qaytish uchun 0 ni kiriting
Dasturdan chiqish uchun boshqa sonni kiriting
7
Dasturdan foydalanganligingiz uchun rahmat
Process finished with exit code 0