Question
Assignment Objectives In addition to the objectives covered in the previous chapter, you must include the following techniques, as demonstrated in your current textbook, to
Assignment Objectives
In addition to the objectives covered in the previous chapter, you must include the following techniques, as demonstrated in your current textbook, to receive full credit for the assignment objectives portion of the Code Grading Rubric:
Defining and Calling a Void Function
Defining and calling Value-Returning Functions
Designing a Program to Use Functions
Local Variables
Global Variables and Global Constants
Passing Arguments to Functions
Generating Random Numbers
1. Football Seating (adapted from #7) Save the file as ch5_ex1.py
There are three sections of seating categories available for an upcoming UTSA Football game at the Alamodome. Section 112 seats (on the 50-yard line) cost $203. Section 113 is on the 40, and those seats cost $121. There are seats way down on the 5 in Section 116 that cost $28. Write a program that asks how many tickets for each section of seats were sold, then display the income generated from ticket sales.
Your program must:
Use three named global constants (SECT_112, SECT_113, and SECT_116) to hold section seat prices.
Include the function class_total() that accepts two arguments: number of seats and section (112, 113, or 116) and returns a total value.
Include the function income() that accepts three arguments: each of the three totals from the previous step and prints income from each class and total revenue.
The output should look like this:
Enter the count of Section 112 seats: 550
Enter the count of Section 113 seats: 660
Enter the count of Section 116 seats: 775
Income from Section 112 seats: $ 111,650
Income from Section 113 seats: $ 79,860
Income from Section 116 seats: $ 21,700
Total income: $ 213,210
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started