Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

In this assessment, you will demonstrate your understanding of basic Python syntax such as IF statements, loops, and functions , using the IDLE editor, and writing a Python program. You will use...

1 answer below »

In this assessment, you will demonstrate your understanding of basic Python syntax such as IF statements, loops, and functions, using the IDLE editor, and writing a Python program.

You will use Flowgorithm and IDLE software on your XenDesktop to plan a program using Flowgorithm and then write a Python program. The program should accept the age of the movie viewer and display the cost of the ticket based upon the following criteria:

Program Criteria
Criteria Ticket Price
Younger than 13, older than 65 $5.00
13 to 17 $7.50
18 to 64 $10.00
Matinee (12 p.m. - 3 p.m.) $5.00 (Note: Use the time library to find what the current time is on your computer to determine if the time merits the Matinee price.)

Make sure your Flowgorithm file is named with the fprg extension and your Python program has a py extension.

Answered Same Day Nov 07, 2021

Solution

Sudipta answered on Nov 08 2021
153 Votes
import datetime
tm=str(datetime.datetime.now().time())
t=tm.split(":")
age=int(input("Enter the age: "))
if (int(t[0])>=12 and int(t[0])<=15):
p=5
elif (age<=13 or age>=65):
p=5
elif (age>=13 and age<=17):
p=7.5
else:
p=10
print("Price of ticket: $",p)
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here