Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CIS 1 1 5 ch 0 2 _ lab 0 2 Complete the program below, using onlineGDB, to calculate the total cost of a meal

CIS115 ch02_lab02
Complete the program below, using onlineGDB, to calculate the total cost of a meal including sales tax and a tip.
The program will prompt the user to input:
1. the cost of the meal,
2. the tip percent
then perform the calculations and print the results.
Sales tax rate is 9.5%, do not calculate a tip on sales tax amount.
Sample output below:
please input the amount of the meal 85.22
enter tip percent as shown >15.5, your number can be different
please input the tip percent for the meal 12.5
Meal cost is 85.22
Tax amount is 8.10
Tip amount is 10.65
Total meal cost is 103.97
==================copy program below this line ===============================
# student name 2024SP ch01_lab02
'''
this program will accept input of a meal cost and then:
1. calculate the sales amount
2. calculate the tip amount
3. print the results to include: meal amount, tip amount, tax amount, total cost
'''
# ===================== program constants
TAX_RATE=???
# =============================== data input
mealAmt=float(input('please input the amount of the meal '))
# ======================== calculations
taxAmt=mealAmt * TAX_RATE
# ============================= print results
print(f'meal cost is {mealAmt: .2f}')
print(f'tax amount is {taxAmt: .2f}')
print(f'tip amount is {tipAmt: .2f}')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions