diff --git a/Chapter 4/Exercise 4.2 b/Chapter 4/Exercise 4.2 new file mode 100644 index 0000000..6b4a0c2 --- /dev/null +++ b/Chapter 4/Exercise 4.2 @@ -0,0 +1,11 @@ +let age = prompt("How old are you?"); +age = Number(age); +let message; +if(age >= 21){ + message = "You can enter and drink."; +}else if(age >= 19){ + message = "You can enter but not drink."; +}else{ + message = "You are not allowed in!"; +} +console.log(message);