Answered step by step
Verified Expert Solution
Link Copied!

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 1. You can copy/paste 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 find_best_ticket. find_best_ticket 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).
#
#find_best_ticket 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,
#find_best_ticket should return False.
#
#As a reminder, every instance of TheaterTicket has a method called
#get_ticket_price. get_ticket_price has one parameter, a quantity.
#get_ticket_price returns the cost of the given quantity of that
#ticket. For example, if quantity is 5 and budget is 500, then the
#function would return the largest number to result from calling
#get_ticket_price(5) from each instance in the list of TheaterTicket.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions