forked from itscodenation/flw1-u1l5-23-24-student-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditionals.js
28 lines (15 loc) · 841 Bytes
/
conditionals.js
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
function quizGame() {
let answer1 = prompt("What is the capital of France?").toLowerCase();
// 1. Write a conditonal statement that checks if answer1 is equal to "paris".
// - If true, alert "Correct!"
// - Else, alert "Wrong!"
// - Note: here's an example of what using an alert looks like: alert("Correct!")
let answer2 = parseInt(prompt("How many legs does an insect have? (Enter a number)"));
// 2. Write a conditonal statement that checks if answer2 is 6.
// - If true, alert "Correct!"
// - Else if answer2 is less than 6, alert "Too low! Insects have 6 legs."
// - Else, alert "Too high! Insects have 6 legs."
alert("Thanks for playing the quiz game!");
}
// 3. Once you've completed the conditionals, uncomment the line below and run your code.
// quizGame();