-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValidation.java
More file actions
56 lines (31 loc) · 1.25 KB
/
Copy pathValidation.java
File metadata and controls
56 lines (31 loc) · 1.25 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
47
48
49
50
51
52
53
54
import java.util.Random;
import javax.swing.JOptionPane;
public class Validation {
public static void main(String[] args) {
for (int i=0; i<10; i++) {
int randomNumber = new Random().nextInt(5);
// 2. On paper, write all the numbers that get printed when you run this class
System.out.println(randomNumber);
// 3. Use the randomNumber to give the user a random compliment.
if (randomNumber == 0) {
JOptionPane.showMessageDialog(null, "You know, you are an amazing person!");
}
// 3. Use the randomNumber to give the user a random compliment.
if (randomNumber == 1) {
JOptionPane.showMessageDialog(null, "Your eyes have that shining luster!");
}
// 3. Use the randomNumber to give the user a random compliment.
if (randomNumber == 2) {
JOptionPane.showMessageDialog(null, "Everyone doesn't know your true potential, once they see you they'll be shocked.");
}
if (randomNumber == 3) {
JOptionPane.showMessageDialog(null, "You are so lucky not to be attacked by Monty Python bunnies! (Esoteric reference)");
}
if (randomNumber == 4) {
JOptionPane.showMessageDialog(null, "Your future will be very bright!");
}
}
// 4. Repeat all the code above 10 times
// 5. Find someone to test out your program. They will like it :)
}
}