Question
After many years, you have developed a system for determining exactly how much to tip when eating out at a restaurant: If the nal bill
After many years, you have developed a system for determining exactly how much to tip when eating out at a restaurant: If the nal bill is $30.00 or less, you will leave a tip of exactly $5.00 (regardless of the quality of service) If the nal bill was greater than $30.00 and the service was good (according to some criteria that we wont bother describing here), you will leave a tip of 25% of the nal bill Otherwise(meaningthatthenalbillwasover$30.00buttheservicewasbad),youwillleaveatipequalto15%of the nal bill. The problem2.py le contains a Python function named tip_amount() that can help you decide how much to leave as a tip. It takes two arguments, in the following order: the amount of the nal bill (a positive oating-point number) and a booleanvaluecategorizingthequalityoftheservice(TrueindicatesgoodserviceandFalseindicatesbadservice). The function returns a oating-point number corresponding to the amount you will leave as a tip. Forexample,tip_amount(12.56, False)returns5.0,representing$5(eventhoughtheservicewasbad,yoursystem still requires you to leave a $5 tip). tip_amount(48.93, True) returns 12.2325, representing a 25% tip (for this problem, dont worry about rounding the tip amounts to two decimal places).
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