-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathL05Q03.java
25 lines (23 loc) · 856 Bytes
/
L05Q03.java
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
import java.util.*;
public class L05Q03 {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
Random random = new Random();
System.out.print("Enter the number of employee : ");
int numEmployee = input.nextInt();
System.out.println();
for (int employee = 1; employee <= numEmployee; employee++){
System.out.println("Empliyee " + employee);
int total = 0;
for(int workDay = 0; workDay < 7; workDay++){
int workHour = random.nextInt(7)+1;
total += workHour;
System.out.print(workHour + " ");
}
System.out.println();
System.out.println("Total work hour : " + total);
System.out.println();
}
input.close();
}
}