-
Notifications
You must be signed in to change notification settings - Fork 0
/
qno27.js
23 lines (23 loc) · 831 Bytes
/
qno27.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"use strict";
// Qno.27
// Alien Colors #3: Turn your if-else chain from Exercise 5-4 into an if-else chain.
// • If the alien is green, print a message that the player earned 5 points.
// • If the alien is yellow, print a message that the player earned 10 points.
// • If the alien is red, print a message that the player earned 15 points.
// • Write three versions of this program, making sure each message is printed for the appropriate color alien.
Object.defineProperty(exports, "__esModule", { value: true });
// GREEN PLAYER:
let alien = "Green";
if (alien === "Green") {
console.log("Player earned 5 points");
}
else if (alien === "Yellow") {
console.log("Player earned 10 points");
}
else if (alien === "Red") {
console.log("Player earned 15 points");
}
else {
console.log("Oops! No points.");
}
;