enter code here
var canIWatch = function(age) { enter code here
if(0 < age < 6) { enter code here
return "You are not allowed to wantch Deadpool after 6.00pm."; enter code here
} enter code here
else if (6 <= age < 17) { enter code here
return "You must be accompanied by a guardian who is 21 or enter code here
older."; enter code here
} enter code here
else if (17 <= age < 25) { enter code here
return "You are allowed to watch Deadpool, right after you enter code here
show some ID."; enter code here
} enter code here
else if (age >= 25) { enter code here
return "Yay! You can watch Deadpool with no strings enter code here
attached!"; enter code here
} enter code here
else { enter code here
return "Invalid age"; enter code here
} enter code here
};
lundi 28 novembre 2016
trying to the code below in JavaScript to take in age and restrict movie viewing
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire