TORONTO KIDS COMPUTER CLUB | Tuesday 17:00 Python Practice – 22.01.04.
20200
post-template-default,single,single-post,postid-20200,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Tuesday 17:00 Python Practice – 22.01.04.

07 Jan Tuesday 17:00 Python Practice – 22.01.04.

Question 1:
Write a program for a movie theater using while loop. It will keep asking your age and display the ticket price, until you enter “quit”. It is free if you are less than 3 years old, otherwise if your age is less than 16 years old or over 65 years old the ticket is $10, otherwise the price is $15. After quit, your program will print the total number of tickets sold and total amount of dollars income.

Sample:
How old are you? 10
$10
How old are you? 2
Free
How old are you? 50
$15
How old are you? 67
$10
How old are you? quit
Total tickets sold: 4
Total income: $35
No Comments

Sorry, the comment form is closed at this time.