Create an algorithm for the computer, which asks the user for age and returns the price that the user needs to pay for the bus ticket.
- – The children under age 14 need to pay 50 cents
- – Adults need to pay $2.
Hints:
- Remember the input command we used in the last post, Sleep Cycle, we have to use it to ask the user for their age.
- Use “if and else” statement to differentiate between children and adults in this format:
- If the individual is 14 years and under, they pay $0.50
- Else (if they’re older than 14), they pay $2.50