-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestion25.ts
24 lines (18 loc) · 876 Bytes
/
question25.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 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.
// printing if
let age:number = 17;
if (age < 18) {
console.log("Congratulations you are above the minimum age");
} else {
console.log("sorry you are below the minimum age");
}
//printing else
let player: string = "babar";
if (player === "shaeen") {
console.log("babar is playing the match i will watch the match");
} else {
console.log("babar is not playing the match i will not watch the match");
}