-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGirls.java
More file actions
79 lines (70 loc) · 1.87 KB
/
Girls.java
File metadata and controls
79 lines (70 loc) · 1.87 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import java.util.Random;
public class Girls {
public static String[] girls = {
"Emma",
"Olivia",
"Ava",
"Isabella",
"Sophia",
"Charlotte",
"Mia",
"Amelia"};
public static void Like(){
Random random = new Random();
int girlIndex = random.nextInt(7);
String physical = GirlPhysical(girls[girlIndex]);
System.out.println("You see " + physical + " Do you like her or would you like to pick someone else?");
}
public static String GirlPhysical(String name) {
Random random = new Random();
String physical = name + " who has ";
int hairColor = random.nextInt(4);
switch (hairColor){
case 0:
physical += "brown hair, ";
break;
case 1:
physical += "red hair, ";
break;
case 2:
physical += "gray hair, ";
break;
case 3:
physical += "black hair, ";
break;
default:
physical += "blonde hair, ";
break;
}
int eyeColor = random.nextInt(3);
switch (eyeColor){
case 0:
physical += "brown eyes, ";
break;
case 1:
physical += "hazel eyes, ";
break;
case 2:
physical += "green eyes, ";
break;
default:
physical += "blue eyes, ";
break;
}
physical += "and is ";
int height = random.nextInt(2);
switch (height){
case 0:
physical += "tall";
break;
case 1:
physical += "short";
break;
default:
physical += "average height";
break;
}
physical += ".";
return physical;
}
}