Question: Add the variables created in Steps 1 3 , storing the results in a variable named subtotal. 5 . Calculate the tax charge by multiplying
Add the variables created in Steps storing the results in a variable named subtotal.
Calculate the tax charge by multiplying the subtotal by Round this result to decimal places, and store
the rounded value in a variable named tax.
Calculate the tip amount by multiplying the subtotal by Round this result to decimal places, and store
the rounded value in a variable named tip.
Calculate the total charge by adding the subtotal, the tax charge, and the tip amount. Store the result in a
variable named totalcharge.
Print the results with descriptive text output as shown below. Replace the xxxxx symbols with the appropriate
values. Match the formatting shown below exactly, including spacing. The dashed lines should contain
dashes. The dollar signs should be vertically aligned, and the prices should be rightaligned with each other and
with the dashed lines. There should be five characters of spacing allotted for each price, but some prices will
only require four spaces. Each price should have exactly two decimal places displayed. This formatting can be
most easily accomplished using fstrings
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
