-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestion27.js
42 lines (42 loc) · 1.56 KB
/
question27.js
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
// Version for a green alien
var alienColorGreen = 'green';
if (alienColorGreen === 'green') {
console.log("Congratulations! You just earned 5 points for shooting down the green alien.");
}
else if (alienColorGreen === 'yellow') {
console.log("Congratulations! You just earned 10 points for shooting down the yellow alien.");
}
else if (alienColorGreen === 'red') {
console.log("Congratulations! You just earned 15 points for shooting down the red alien.");
}
else {
console.log("No points earned. Keep shooting!");
}
// Version for a yellow alien
var alienColorYellow = 'yellow';
if (alienColorYellow === 'green') {
console.log("Congratulations! You just earned 5 points for shooting down the green alien.");
}
else if (alienColorYellow === 'yellow') {
console.log("Congratulations! You just earned 10 points for shooting down the yellow alien.");
}
else if (alienColorYellow === 'red') {
console.log("Congratulations! You just earned 15 points for shooting down the red alien.");
}
else {
console.log("No points earned. Keep shooting!");
}
// Version for a red alien
var alienColorRed = 'red';
if (alienColorRed === 'green') {
console.log("Congratulations! You just earned 5 points for shooting down the green alien.");
}
else if (alienColorRed === 'yellow') {
console.log("Congratulations! You just earned 10 points for shooting down the yellow alien.");
}
else if (alienColorRed === 'red') {
console.log("Congratulations! You just earned 15 points for shooting down the red alien.");
}
else {
console.log("No points earned. Keep shooting!");
}