Please send questions to
st10@humboldt.edu .
* event-controlled loop
* repeat until some "event" occurs, making the
while's condition false
* example: ask the user for a ticket price, and
determine how many performances it would take
to get to 500 attendees at that ticket price
* contract: event1: void -> void
def event1():
purpose: is to ask the user for a ticket price, and
determine and print to the screen how many performances
it would take to get to 500 attendees at that ticket price
example: if when you run event1() you enter a
ticket price of 5, then the following
should be printed to the screen:
It will take 5 performances to get to at least 500 attendees
# get desired ticket price from user
# initialize needed variables
# num_performances, total_attendees
# find out how many attendees per performance at
# this ticket price
# while total_attendees < 500
increase num_performances
add 1-performance attendees to total_attendees
# print out the final num_performances