In this problem this purpose of this program is to compute


Can you explain to me the layout as to how to write a function?

In this problem: This purpose of this program is to compute the amount of a tip to leave at a restaurant after a meal. The program asks the user for the amount on the bill and the number of diners at the table.If the number of diners is six or more, the default tip percentage will be 18%. If the number of diners is less than six, the program will ask the user for the desired tip percentage. The program then prints the original amount of the bill, the calculated tip amount, and the total amount. You may assume that all user inputs are valid. You do not have to worry about printing only two digits after a decimal point. You do not have to comment your program.

I know I begin with def whatToPay():

However, I don't understand how I should write the rest. The function would be amount = bill * tip. How should I define my parameters? Or even, what are my parameters? Is it bill, tip, and diners? I am completely lost.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: In this problem this purpose of this program is to compute
Reference No:- TGS02511973

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)