Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

valid_ticket_price Write a shell (text-based) program, called valid_ticket_price.py, that prompts the user for their age and, depending on the user's response, prints out 1

image text in transcribed

valid_ticket_price Write a shell (text-based) program, called valid_ticket_price.py, that prompts the user for their age and, depending on the user's response, prints out 1 of the 3 sentences below. Children 5 and under are free, so your price is $0. Seniors 60 and over are 1/2 off, so your price is $10. Your price is $20. The program must validate the input by forcing the user to type in a number between 0 and 100. As long as the user types in numbers less than 0 or greater than 100, the program should print an error and ask the user to type in the age again. Note the program need not worry about the user typing in letters instead of numbers. Below is an example of a confused user using the program. PS C:\Users\ssiva\Desktop> python valid_ticket_price.py What is your age? -5 That is not a valid age. Number must ho What is YOUT

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

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

1119563097, 9781119563099

Students also viewed these Mathematics questions

Question

What is a budget? (LO 1)

Answered: 1 week ago

Question

What does the term break-even point mean? (LO 5)

Answered: 1 week ago

Question

What is a periodic budget? (LO 4)

Answered: 1 week ago