A5 - if Statements in C
Resource: C If..Else - Down to the else if subsection is relevant.
Please run the update, then examine the example code in the file if-statements.c that will appear in your C folder.
Your Task
Add a function to if-statements.c called void getPrice(), and add a call to it in main() (feel free to comment the calls to the other two functions while you're working on this).
Inside getPrice(), ask the user their age.
You should then tell them their cost of admission into a movie based on the following criteria:
- If they're under five, they're free
- If they're between 5 and 12 (inclusive), they pay $10
- If they're between 13 and 17 (inclusive), they pay $12
- If they're between 18 and 64 (inclusive), they pay $15
- if they're 65 or over, they pay $13