-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctionexercise5.js
More file actions
39 lines (35 loc) · 1.09 KB
/
functionexercise5.js
File metadata and controls
39 lines (35 loc) · 1.09 KB
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
32
33
34
35
36
37
38
39
/**
*
* @authors Your Name (you@example.org)
* @date 2018-05-29 15:20:08
* @version $Id$
*/
function checkDriverAge(){
var age = prompt("What is your age?");
if (Number(age) < 18) {
alert("Sorry, you are too yound to drive this car. Powering off");
} else if (Number(age) > 18) {
alert("Powering On. Enjoy the ride!");
} else if (Number(age) === 18) {
alert("Congratulations on your first year of driving. Enjoy the ride!");
}
}
var checkDriverAge2 = function(){
var age = prompt("What is your age?");
if (Number(age) < 18) {
alert("Sorry, you are too yound to drive this car. Powering off");
} else if (Number(age) > 18) {
alert("Powering On. Enjoy the ride!");
} else if (Number(age) === 18) {
alert("Congratulations on your first year of driving. Enjoy the ride!");
}
}
function checkDriverAge(age){
if (Number(age) < 18) {
alert("Sorry, you are too yound to drive this car. Powering off");
} else if (Number(age) > 18) {
alert("Powering On. Enjoy the ride!");
} else if (Number(age) === 18) {
alert("Congratulations on your first year of driving. Enjoy the ride!");
}
}