-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudents.java
More file actions
37 lines (31 loc) · 924 Bytes
/
Students.java
File metadata and controls
37 lines (31 loc) · 924 Bytes
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 Students {
public static void main(String[] args){
try {
Scanner s = new Scanner(System.in);
int students = 0;
while (students != 25) {
System.out.println("How many students in the room?");
students = s.nextInt();
}
System.out.println("Class can start");}
catch (Exception e){
}
/*int students = Input();
for (int i = 0; i < 1;){
if (students != 25) {
students = Input();
}
else {
System.out.println("Class can start");
i++;
}
}*/
}
private static int Input(){
Scanner s = new Scanner(System.in);
System.out.println("How many students in the room?");
int student = s.nextInt();
return student;
}
}