Question: please use Python to solve this problem bb.csueastbay.edu Search Results Course Content A Modular Program Write a program that will ask the user for the
bb.csueastbay.edu Search Results Course Content A Modular Program Write a program that will ask the user for the cost of a meal, compute the tip for the meal (18%), compute the tax on the meal (8.25%), and then displays the cost of the meal, the tip amount for the meal, the tax on the meal, and the total of the meal which is a sum of the cost, tip, and tax amount. Your prog am will do this by using the following functions you will write get cost This function accepts no arguments, This function asks the user to enter the cost of the meal, validates t. and returns the validated amount. The functi greater on rejects any negative input, so it will only accept input that is 0 or compute tip: Accepts the cost of the meal as it's only argument. Computes and resturns the total amount of the tip. Does not interact with the user in compute tax: Acce Does not interact with the user in any way. pts the cost of the meal as it's only argument. Computes and returns the total tax on the meal. compute sgrand total: Accepts the cost of the meal, the tax on the meal and thetip for the meal as ts only arguments. the cost of the meal, the tax on the meal, and the tip for the meal as it's only Adds them all together and returns the sum. Does not interact with the user in any way display total,cost: Accepts the cost of the meal, the tax on the meal the tip for the meal, and the grand total of the meal as it's only arguments. It then displays each of these amounts with an appropriate label and formatted to 2 decimal places of precision. main: This function incorporates th logic of the program and calls the other functions, storing data returned in appropriate variables and passing the variables as arguments to the functions as needed. Does not directly interact with the user in any way Hints: Write and test each function, one at a time. . The only two functions that interact with the user directly are display_total_cost and get.cost. No other function has an input function or a print function. A 20-Point Sample Run: Enter cost of meal: 19.95 cost: s 19.95 3.59 S 1.65 25.19 rip: Tax: Total: SES Submission Instructions: 17
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
