enter code herevar canIWatch = function(age) { enter code hereif(0 < age < 6) { enter code herereturn "You are not allowed to wantch Deadpool after 6.00pm."; enter code here} enter code hereelse if (6 <= age < 17) { enter code herereturn "You must be accompanied by a guardian who is 21 or enter code hereolder."; enter code here} enter code hereelse if (17 <= age < 25) { enter code herereturn "You are allowed to watch Deadpool, right after you enter code hereshow some ID."; enter code here} enter code hereelse if (age >= 25) { enter code herereturn "Yay! You can watch Deadpool with no strings enter code hereattached!"; enter code here} enter code hereelse { enter code herereturn "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