diff --git a/Chapter 4/Exercise 4.4 b/Chapter 4/Exercise 4.4 new file mode 100644 index 0000000..4de299f --- /dev/null +++ b/Chapter 4/Exercise 4.4 @@ -0,0 +1,21 @@ +const randomNumber = Math.floor(Math.random() * 6); +let answer = "Something went wrong"; +let question = prompt("Ask me anything"); +switch (randomNumber) { + case 0: + answer = "It will work out"; + break; + case 1: + answer = "Maybe, maybe not"; + break; + case 2: + answer = "Probably not"; + break; + case 3: + answer = "Highly likely"; + break; + default: + answer = "I don't know about that"; +} +let output = "You asked me " + question + ". I think that " + answer; +console.log(output);