There is an amusement park where children of a certain age get a discount. At the ticket
Fantastic news! We've Found the answer you've been seeking!
Question:
There is an amusement park where children of a certain age get a discount. At the ticket kiosk, the computer asks the age of the participant. If their age is younger than 15, the entrance price is $20. If their age is 15 or older, the price is $40.
To address the scenario, you will need to code a branching decision that does the following:
- Asks the user for their age
- Creates a message that will indicate the price of the ticket. The message should say, "The entrance price is _____."
- Prints the correct price based on the user's input of their age.Determine the variables and relevant data types of each variable. Consider the necessary variables required to implement the logic of your game as well as the relevant data type (e.g., integer or float) of each variable.
- Set a branch that uses conditionals to define the logic of the game. This must meet the requirements of the program. This includes using the following:
- IF
- IF-ELSE
- IF-ELSE-IF
- == (equals)
- != (not equal)
- < (less than)
- > (greater than)
- <= (less than or equal)
- >= (greater than or equal)
- Apply necessary arithmetic operations. Note that mathematical operators include +, -, *, /, and % (modulo). This must meet the requirements of the program.
- Write code using best practices including appropriate syntax and commenting. This includes the following:
- Using descriptive names for your variables
- Using the correct formatting structure with appropriate indentations
- Using appropriate comments relating to your code
Related Book For
Cost Accounting A Managerial Emphasis
ISBN: 978-0133428704
15th edition
Authors: Charles T. Horngren, Srikant M. Datar, Madhav V. Rajan
Posted Date: