Skip to content

Instantly share code, notes, and snippets.

@HarcourtHamsa
Created October 11, 2022 14:11
Show Gist options
  • Save HarcourtHamsa/271cd1058a424a8ad35ea5d6ca7e39cd to your computer and use it in GitHub Desktop.
Save HarcourtHamsa/271cd1058a424a8ad35ea5d6ca7e39cd to your computer and use it in GitHub Desktop.
Class assignment
/**
* You’ve been asked by the local movie theater managers to implement some JavaScript for a new automated system they’re building.
*
*
* They want to be able to work out whether someone is allowed into a PG-13 movie or not.
*
* The rules are, if someone is 13 or over, they’re allowed in. If they’re not over 13, but they are accompanied by an adult, they’re also allowed in.
* Otherwise, they can’t see the movie.
*
* var age = 12;
* var accompanied = true;
* ???
*
* Finish this example using the age and accompanied variables to work out whether this 12-year-old is allowed to see the movie.
*
* Try changing the values (for example, set age to 13 and accompanied to false) and see if your code still works out the right answer.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment