SlideShare a Scribd company logo
1 of 2
Download to read offline
Write the program using Python.
stadium.py (30 points)
There are three seating categories at a stadium. Class A seats cost $20, class B seats cost $15,
and Class C seats cost $10. Write a program that asks how many tickets are each class of seats
were sold, then display the amount of income generated from ticket sales.
Hints:
Define main ():
Declare local variables under main() program. income_Aseats = 0.0, income_Bseats = 0.0,
income_Cseats = 0.0, category = "", num_tickets = 0, seating_price = 0.0, need_more_tickets
= 'Y'
Write while loop, to get the user input and price based on the category
Calculate income
Verify if the Category is A or B or C . //with If , elif statements
Prompt the User if they need more tickets
Write the showIncome function to accepts the income from class A, B, and C seats and
displays the total income.
Calculate total income. i.e. total_income = income_Aseats + income_Bseats +
income_Cseats
Display total income
Write getSeatingPrice function to get seat category. ie. if elif for A, B, and C
Write getUserInput function to prompt the User for getting the Category and number of
tickets
return category, num_tickets to the main function from where they have been called
Sample Output:
Welcome to the Stadium Seating Application
Category A - $20
Category B - $15
Category C - $10
Enter the category (A, B or C): A
Enter the number of tickets required: 10
Do you need more tickets?
press Y to continue or press N to quit: N
Income from class A seats: $200.00
Income from class B seats: $0.00
Income from class C seats: $0.00
Total income: $200.00

More Related Content

More from krishahuja1992

More from krishahuja1992 (20)

Write a program in Java that displays a GUI fast food menu with chec.pdf
Write a program in Java that displays a GUI fast food menu with chec.pdfWrite a program in Java that displays a GUI fast food menu with chec.pdf
Write a program in Java that displays a GUI fast food menu with chec.pdf
ย 
Why my ocr is not performing for multi page pdf in javaimport java.pdf
Why my ocr is not performing for multi page pdf in javaimport java.pdfWhy my ocr is not performing for multi page pdf in javaimport java.pdf
Why my ocr is not performing for multi page pdf in javaimport java.pdf
ย 
Why was the bank seized by federal regulatorsWhich of the thr.pdf
Why was the bank seized by federal regulatorsWhich of the thr.pdfWhy was the bank seized by federal regulatorsWhich of the thr.pdf
Why was the bank seized by federal regulatorsWhich of the thr.pdf
ย 
Why is it important for real estate developers to work with various .pdf
Why is it important for real estate developers to work with various .pdfWhy is it important for real estate developers to work with various .pdf
Why is it important for real estate developers to work with various .pdf
ย 
Which statement is NOT trueFailing to reject the null hypothesis .pdf
Which statement is NOT trueFailing to reject the null hypothesis .pdfWhich statement is NOT trueFailing to reject the null hypothesis .pdf
Which statement is NOT trueFailing to reject the null hypothesis .pdf
ย 
will upvote if answer is good 5) Simplify the following Boolean func.pdf
will upvote if answer is good 5) Simplify the following Boolean func.pdfwill upvote if answer is good 5) Simplify the following Boolean func.pdf
will upvote if answer is good 5) Simplify the following Boolean func.pdf
ย 
Whichofthe folowing si NOT aprinciple of basic financial managemen.pdf
Whichofthe folowing si NOT aprinciple of basic financial managemen.pdfWhichofthe folowing si NOT aprinciple of basic financial managemen.pdf
Whichofthe folowing si NOT aprinciple of basic financial managemen.pdf
ย 
Willa, reci๏ฟฝn graduada de la universidad con poca experiencia relaci.pdf
Willa, reci๏ฟฝn graduada de la universidad con poca experiencia relaci.pdfWilla, reci๏ฟฝn graduada de la universidad con poca experiencia relaci.pdf
Willa, reci๏ฟฝn graduada de la universidad con poca experiencia relaci.pdf
ย 
Write a 12 page essay that explains why import and export documents.pdf
Write a 12 page essay that explains why import and export documents.pdfWrite a 12 page essay that explains why import and export documents.pdf
Write a 12 page essay that explains why import and export documents.pdf
ย 
Why the system says cannot find symbol of Calendar though I said imp.pdf
Why the system says cannot find symbol of Calendar though I said imp.pdfWhy the system says cannot find symbol of Calendar though I said imp.pdf
Why the system says cannot find symbol of Calendar though I said imp.pdf
ย 
Why do some populations growWhat factors help to determine the ra.pdf
Why do some populations growWhat factors help to determine the ra.pdfWhy do some populations growWhat factors help to determine the ra.pdf
Why do some populations growWhat factors help to determine the ra.pdf
ย 
Why are intravenous (IV) drug users at greater risk for skin abscess.pdf
Why are intravenous (IV) drug users at greater risk for skin abscess.pdfWhy are intravenous (IV) drug users at greater risk for skin abscess.pdf
Why are intravenous (IV) drug users at greater risk for skin abscess.pdf
ย 
Which statement about Hadoop is correcta) b) c).pdf
Which statement about Hadoop is correcta) b) c).pdfWhich statement about Hadoop is correcta) b) c).pdf
Which statement about Hadoop is correcta) b) c).pdf
ย 
With statistics, we have the data but we do not know the conditions..pdf
With statistics, we have the data but we do not know the conditions..pdfWith statistics, we have the data but we do not know the conditions..pdf
With statistics, we have the data but we do not know the conditions..pdf
ย 
You noted that organic foods are healthier and I found one study tha.pdf
You noted that organic foods are healthier and I found one study tha.pdfYou noted that organic foods are healthier and I found one study tha.pdf
You noted that organic foods are healthier and I found one study tha.pdf
ย 
You learned in the previous lesson that T cells require two independ.pdf
You learned in the previous lesson that T cells require two independ.pdfYou learned in the previous lesson that T cells require two independ.pdf
You learned in the previous lesson that T cells require two independ.pdf
ย 
Who was James Callender Why was he at odds with JeffersonWho was.pdf
Who was James Callender Why was he at odds with JeffersonWho was.pdfWho was James Callender Why was he at odds with JeffersonWho was.pdf
Who was James Callender Why was he at odds with JeffersonWho was.pdf
ย 
You got hired as an HR manager at a new start-up IT organization bas.pdf
You got hired as an HR manager at a new start-up IT organization bas.pdfYou got hired as an HR manager at a new start-up IT organization bas.pdf
You got hired as an HR manager at a new start-up IT organization bas.pdf
ย 
You are the IT administrator for a small corporate network. Several .pdf
You are the IT administrator for a small corporate network. Several .pdfYou are the IT administrator for a small corporate network. Several .pdf
You are the IT administrator for a small corporate network. Several .pdf
ย 
which two answers provide examples of general change in diverse and .pdf
which two answers provide examples of general change in diverse and .pdfwhich two answers provide examples of general change in diverse and .pdf
which two answers provide examples of general change in diverse and .pdf
ย 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
ย 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
ย 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
ย 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
ย 

Recently uploaded (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
ย 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
ย 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
ย 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
ย 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
ย 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
ย 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
ย 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
ย 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
ย 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
ย 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
ย 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
ย 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
ย 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
ย 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
ย 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
ย 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
ย 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
ย 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ย 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
ย 

Write the program using Python.stadium.py (30 points)There are t.pdf

  • 1. Write the program using Python. stadium.py (30 points) There are three seating categories at a stadium. Class A seats cost $20, class B seats cost $15, and Class C seats cost $10. Write a program that asks how many tickets are each class of seats were sold, then display the amount of income generated from ticket sales. Hints: Define main (): Declare local variables under main() program. income_Aseats = 0.0, income_Bseats = 0.0, income_Cseats = 0.0, category = "", num_tickets = 0, seating_price = 0.0, need_more_tickets = 'Y' Write while loop, to get the user input and price based on the category Calculate income Verify if the Category is A or B or C . //with If , elif statements Prompt the User if they need more tickets Write the showIncome function to accepts the income from class A, B, and C seats and displays the total income. Calculate total income. i.e. total_income = income_Aseats + income_Bseats + income_Cseats Display total income Write getSeatingPrice function to get seat category. ie. if elif for A, B, and C Write getUserInput function to prompt the User for getting the Category and number of tickets return category, num_tickets to the main function from where they have been called Sample Output: Welcome to the Stadium Seating Application Category A - $20 Category B - $15 Category C - $10 Enter the category (A, B or C): A Enter the number of tickets required: 10 Do you need more tickets? press Y to continue or press N to quit: N Income from class A seats: $200.00
  • 2. Income from class B seats: $0.00 Income from class C seats: $0.00 Total income: $200.00