TheaterTicket #Create a class called TheaterTicket. #should have two attributes (instance variables): section #and matinee. Make sure the variable names match those #words. section will be a string; matinee will be a boolean. # #TheaterTicket should have a constructor with two required #parameters, one for each of those attributes (section and #matinee in that order). # #TheaterTicket should also have a method called #get_ticket_price. get_ticket_price should have one #additional parameter (other than self): quantity, an #integer representing the number of tickets between 1 and # 10. # #get_ticket_price should return the price of the tickets #represented by the instance. The price is determined first #by section: # #-If section is 'floor', the price is 200. #-If section is 'orchestra', the price is 100. # - If section is 'mezzanine', the price is 60. # - If section is 'gallery', the price is 30. # #The section price is multiplied by the number of tickets. #Then, if matinee is true, $20 per ticket is deducted from #the final cost. The price should be returned as an integer. # #For example: # # test_ticket = TheaterTicket('floor' #print(test_ticket.get_ticket_price # #A floor ticket is $200. There are 5 tickets, for a total #of $1000. The show is a matinee, so $20 per ticket is #deducted, and $1000 ($20 * 5) = $900. So, the method 800 #ro True) (5)) -> 900
TheaterTicket #Create a class called TheaterTicket. #should have two attributes (instance variables): section #and matinee. Make sure the variable names match those #words. section will be a string; matinee will be a boolean. # #TheaterTicket should have a constructor with two required #parameters, one for each of those attributes (section and #matinee in that order). # #TheaterTicket should also have a method called #get_ticket_price. get_ticket_price should have one #additional parameter (other than self): quantity, an #integer representing the number of tickets between 1 and # 10. # #get_ticket_price should return the price of the tickets #represented by the instance. The price is determined first #by section: # #-If section is 'floor', the price is 200. #-If section is 'orchestra', the price is 100. # - If section is 'mezzanine', the price is 60. # - If section is 'gallery', the price is 30. # #The section price is multiplied by the number of tickets. #Then, if matinee is true, $20 per ticket is deducted from #the final cost. The price should be returned as an integer. # #For example: # # test_ticket = TheaterTicket('floor' #print(test_ticket.get_ticket_price # #A floor ticket is $200. There are 5 tickets, for a total #of $1000. The show is a matinee, so $20 per ticket is #deducted, and $1000 ($20 * 5) = $900. So, the method 800 #ro True) (5)) -> 900
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
The question asks me to create a class TheaterTicket and a function called get_ticket_price. The second question requires the usage of get_ticket_price by calling it, to create a process called find_best_ticket. I could not determine how to use the get_ticket_price function from the first part of the question to obtain a value in find_best_ticket.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY