Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Programming In Java An Interdisciplinary Approach

Authors: Robert Sedgewick, Kevin Wayne

2nd Edition

0672337843, 9780672337840

More Books

Students also viewed these Programming questions