-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAvailabiltyMessages.java
More file actions
46 lines (42 loc) · 1.81 KB
/
AvailabiltyMessages.java
File metadata and controls
46 lines (42 loc) · 1.81 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
46
import javax.swing.JOptionPane;
import java.util.Random;
public class AvailabiltyMessages {
public static void main(String[] args) {
Random random = new Random();
int choice = random.nextInt(10); // generates a number between 0 and 9
String message = "";
switch (choice) {
case 0:
message = "I'll not be available in the first half today. Need to go for my Dentist.";
break;
case 1:
message = "Due to electricity issue I will not be available for some time.";
break;
case 2:
message = "Due to emergency I am not available for 1 hour.";
break;
case 3:
message = "Internet issue from my side. I won't be available for some time.";
break;
case 4:
message = "I will be reaching the office late today due to heavy traffic.";
break;
case 5:
message = "I am not available in first half today.";
break;
case 6:
message = "Power cut at my place so I will not be available from now.";
break;
case 7:
message = "My laptop is under update. I am available once it is up.";
break;
case 8:
message = "Please note Tomorrow I will be unavailable from 11:30 AM to 4:30 PM. Will compensate those hours later in the evening.";
break;
case 9:
message = "I'm not well, going to the clinic. I’ll try to come online later or in the second half today.";
break;
}
JOptionPane.showMessageDialog(null, message, "⏰ Availability Update", JOptionPane.INFORMATION_MESSAGE);
}
}