TORONTO KIDS COMPUTER CLUB | PMCA Sunday 16:00 Python Homework 20.01.12.
16859
post-template-default,single,single-post,postid-16859,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

PMCA Sunday 16:00 Python Homework 20.01.12.

15 Jan PMCA Sunday 16:00 Python Homework 20.01.12.

Question 1:
Write a program using while loop. The program will ask the user to enter an ingredient for pizza. Every time you enter an ingredient, the program will show the message “We will add …. into your pizza.”, until you enter “quit”.

Sample:
Please enter an ingredient for your pizza: mushroom
We will add mushroom into your pizza.
Please enter an ingredient for your pizza: green pepper
We will add green pepper into your pizza.
Please enter an ingredient for your pizza: cheese
We will add cheese into your pizza.
Please enter an ingredient for your pizza: quit


Question 2:
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 the loop, it will show how much money people have paid in total.

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 money received: $35

No Comments

Sorry, the comment form is closed at this time.