-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassi26.ts
23 lines (22 loc) · 934 Bytes
/
assi26.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export {};
// // assingment :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.
let alien_color = "green";
if (alien_color == "green") {
console.log(
"player just erned 5 points for shooting for shooting green Alien "
);
}
if (alien_color != "green") {
console.log("player just erned 10 points for shooting Alien");
}
if (alien_color == "green") {
console.log(
"player just erned 5 points for shooting for shooting green Alien "
);
} else {
console.log("player just erned 10 points for shooting Alien");
}