Question
write a program that takes in a string that holds the values day or night and an integer that holds a person's age, and outputs
write a program that takes in a string that holds the values "day" or "night" and an integer that holds a person's age, and outputs a movie ticket price. Movie prices are free for everyone under the age of 4. Daytime prices are $8 for everyone age 4 or higher. Nighttime prices are $12 for ages 4 - 16, $15 for ages 17 - 54 and $13 for ages 55 and above.
Ex: If the input is:
night 50
the output is:
$15
Ex: If the input is:
day 15
the output is:
$8
Ex: If the input is:
night 3
the output is:
free
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Introduction To Programming In Java An Interdisciplinary Approach
Authors: Robert Sedgewick, Kevin Wayne
2nd Edition
0672337843, 9780672337840
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App