Kay,
first i am going to start this off by saying this is for my intro to prog. class (meaning im a beginner) so sorry if this is a stupid question or i'm missing something stupid.
HOWEVER I am supposed to make a program to report the income for football tickets sold.
it must end up looking like this:
How many season ticket seats were sold? 100
How many non-season ticket seats were sold? 300
How many student seats were sold? 200
Total Income: $6900.00
here is the actual assignment:
There are three seating categories at ACU Elmer Gray Stadium. For a football game, a season ticket costs $15, non-season ticket costs $12, and student seating costs $9. Write a program that asks how many tickets were sold for each category of seating, and then display the amount of income generated from ticket sales.
Pass those values to a function by calling the following function:
showIncome(SeasonSeats, NonSeasonSeats, StudentSeats)
The function should be declared like this:
def showIncome(incomeSeason, incomeNonSeason, incomeStudent):
Use the function call and the function definition exactly as given above.
Python keeps telling me "SeasonSeats is not defined". What am I doing wrong?
def showIncome(incomeSeason, incomeNonSeason, incomeStudent):
income = float(incomeSeason) + float(incomeNonSeason) + float(incomeStudent)
print("Total Income: $%.2f" %income)
showIncome(SeasonSeats, NonSeasonSeats, StudentSeats)
SeasonSeats = input("How many season ticket seats were sold?")
NonSeasonSeats = input("How many non-season ticket seats were sold?")
StudentSeats = input("How many student ticket seats were sold?")
SeasonSeats = SeasonSeats * 15.0
NonSeasonSeats = NonSeasonSeats * 12.0
StudentSeats = StudentSeats * 9.0