Exercise 4.5
This commit is contained in:
parent
83d1446612
commit
49c6b969b3
22
Chapter 4/Exercise 4.5
Normal file
22
Chapter 4/Exercise 4.5
Normal file
@ -0,0 +1,22 @@
|
||||
let prize = prompt("Pick a number 0-10");
|
||||
prize = Number(prize);
|
||||
let output = "My Selection: ";
|
||||
switch (prize){
|
||||
case 0:
|
||||
output += "Gold ";
|
||||
case 1:
|
||||
output += "Coin ";
|
||||
break;
|
||||
case 2:
|
||||
output += "Big ";
|
||||
case 3:
|
||||
output += "Box of ";
|
||||
case 4:
|
||||
output += "Silver ";
|
||||
case 5:
|
||||
output += "Bricks ";
|
||||
break;
|
||||
default:
|
||||
output += "Sorry Try Again";
|
||||
}
|
||||
console.log(output);
|
||||
Loading…
x
Reference in New Issue
Block a user