Question: For this coding task, assume you are a software engineer for the company Restaurants - R - Us . A new client has been acquired,

For this coding task, assume you are a software engineer for the company Restaurants-R-Us.
A new client has been acquired, and that restaurant has decided to modify its business model by requiring a tip that is calculated using a simple algorithm. You think it's a ridiculous idea that a tip should be required, but you are willing to go along with your boss's wishes and develop a python program that implements such an algorithm.
Required Tip=A+B+C
A = Number of Adults)^1.4+(Number of Children)^0.8
B = cost of most expensive meal if (cheapestMeal mostExpensiveMeal/2),
otherwise square root of (mostExpensiveMeal - cheapestMeal)
C=10% of total dining bill if number of sodas consumed was more than the total
number of adults plus children, otherwise 15% of total bill
Figure 3: Tip Formula - note that 1.4 and 0.8 are exponents
Your manager has asked you write a python program that implements this algorithm. Because RestaurantsR-Us is a software development company that follows good practices, the following rules are also being imposed on your program:
Your program file must be called tipCalculator.py
You program must have a main() function
You must define separate custom functions for portions A, B and C of the algorithm
You should at a minimum include a fourth custom function, named calcTip
The main() function can invoke any of the standard functions available in python (int (), input (), print (), etc.), but can invoke just a single of your custom functions.
The main() function should be at most 15 lines of code (it can be coded in far fewer)
The program must prompt the user for the inputs needed to perform the required tip calculation
The output of your program should provide a tip amount in the form of dollars and cents,
for example $14.33. The output $22.5 is incorrect, as is $15.
Three sample invocations of a program that implements the algorithm are shown below.
 For this coding task, assume you are a software engineer for

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!