-
Notifications
You must be signed in to change notification settings - Fork 0
/
qno25.ts
31 lines (25 loc) · 875 Bytes
/
qno25.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
25
26
27
28
29
30
31
// Qno.25
// Alien Colors #1: Imagine an alien was just shot down in a game. Create a variable called alien_color and assign it a value of 'green', 'yellow', or 'red'.
// • Write an if statement to test whether the alien’s color is green. If it is, print a message that the player just earned 5 points.
// • Write one version of this program that passes the if test and another that fails. (The version that fails will have no output.)
let alien_color:string= "Green";
if (alien_color== "Green"){
console.log("You earned 5 points")
}
else{
console.log("{}")
};
let Alian_color:string="Yellow";
if (Alian_color== "Yellow"){
console.log("you earned 10 points")
}
else{
console.log("{}")
};
let alian_Color:string="Red";
if (alian_Color== "Green"){
console.log("You earned 5 points")
}
else{
console.log("{}")
};