-
Notifications
You must be signed in to change notification settings - Fork 0
/
qno26.js
36 lines (36 loc) · 1.09 KB
/
qno26.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
"use strict";
// Qno.26/
// Alien Colors #2: Choose a color for an alien as you did in Exercise 25, and write an if-else chain.
// • If the alien’s color is green, print a statement that the player just earned 5 points for shooting the alien.
// • If the alien’s color isn’t green, print a statement that the player just earned 10 points.
// • Write one version of this program that runs the if block and another that runs the else block.
Object.defineProperty(exports, "__esModule", { value: true });
// \\//\\//\\//\\//\\//\\//\\//\\
let alian_color = "Green";
if (alian_color == "Green") {
console.log("Player earned 5 points ,for shooting the alian.");
}
else {
console.log("Player earned 10 points");
}
;
/////////////////////////////////
// IF BLOCK RUNS:
let Alien_color = "Blue";
if (Alien_color == "Blue") {
console.log("Player earned 20 points.");
}
else {
console.log("{}");
}
;
//\/\/\\/\/\\/\//\/\/\\\/\\//\/\/\
// ELSE BLOCK RUNS:
let Alian_Color = "Orange";
if (alian_color == "Green") {
console.log("{}");
}
else {
console.log("Player earned 18 points.");
}
;