-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq26.ts
More file actions
20 lines (13 loc) · 692 Bytes
/
q26.ts
File metadata and controls
20 lines (13 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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.
export default function q26(){
let alien_color: string = 'yellow';
if (alien_color === 'green') {
console.log("Congratulations! You just earned 5 points!");
} else {
console.log("Congratulations! You just earned 10 points!");
}
}
q26();