Question
Write a python function calculate_total that takes 3 parameters: a. meal : the cost of the meal b. tax_rate : the percent tax (e.g., NJ
Write a python function calculate_total that takes 3 parameters: a. meal: the cost of the meal b. tax_rate: the percent tax (e.g., NJ tax would be 0.07) c. tip_rate: the percent tip (e.g., a 20% tip rate is 0.20)
Proper tipping technique dictates that the tip should be calculated based on the total cost of the meal, before tax is applied. Then, print out the total with 2 decimal places. Dont forget the dollar sign ($)!
Prompt the user to enter the cost of the meal, the tax rate, and the tip rate. Your final program should make two calls to calculate_total: one based on input from the user and one using the following call:
calculate_total(53.48, .07, .18). Note that the total for the above meal with tax & tip is $66.85.
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