Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Hi, I actually had a question about Python coding. Option 2 - Tip Calculator This is a program that calculates three options for an appropriate tip...

Hi, I actually had a question about Python coding.

Option 2 - Tip Calculator

This is a program that calculates three options for an appropriate tip to leave after a meal at a restaurant. Specifications are as follows: • The program should calculate and display the cost of tipping at 15%, 20%, or 25%. • Assume the user will enter valid data. • The program should round results to a maximum of two decimal places. • Use a for loop and the range function so that you only need to use one set of statements to calculate and print all 3 values.

()()cost_of_meal = (input())()percent = .15tip_amount = cost_of_meal * percenttotal_amount = tip_amount + cost_of_meal percent range(15, 30, 5):(str(round(percent, 2)) + )( + str(round(tip_amount, 2)))( + str(round(total_amount, 2)))()

I cannot get the output to give me the 20 or 25 percent results.

Cost of Meal: 52.31

15%

Tip amount:  7.85

Total amount: 60.16

20%

Tip amount:  7.85

Total amount: 60.16

25%

Tip amount:  7.85

Total amount: 60.16

That's the result. Thanks in advance

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question