Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#This problem will make use of the TheaterTicket class you wrote #in Problem 1 . You can copy / paste it into this problem if
#This problem will make use of the TheaterTicket class you wrote
#in Problem You can copypaste it into this problem if you want
#to but you don't need to When you click Submit, your code will
#be tested with our TheaterTicket class.
#
#Write a function called findbestticket. findbestticket should
#have three parameters: a list of available tickets a list of
#instances of the TheaterTicket class a quantity an integer
#and a budget an integer
#
#findbestticket should return the price of the most expensive
#tickets available from the list that is less than or equal to
#the given budget for the given quantity of tickets. If there are no
#available tickets that come under the budget for the given quantity,
#findbestticket should return False.
#
#As a reminder, every instance of TheaterTicket has a method called
#getticketprice. getticketprice has one parameter, a quantity.
#getticketprice returns the cost of the given quantity of that
#ticket. For example, if quantity is and budget is then the
#function would return the largest number to result from calling
#getticketprice from each instance in the list of TheaterTicket.
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