Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Perform the following steps in a single code cell. 1 . Use the * operator to calculate the total cost of the side salads. Store
Perform the following steps in a single code cell.
Use the operator to calculate the total cost of the side salads. Store the result in a variable named sscost
Use the operator to calculate the total cost of the hamburgers. Store the result in a variable named hbcost
Use the operator to calculate the total cost of the diet sodas. Store the result in a variable named dscost
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.
Side Salads: $xxxxx
Hamburgers: $xxxxx
Diet Sodas: $xxxxx
Subtotal: $xxxxx
Tax : $xxxxx
Tip : $xxxxx
Total Charge: $xxxxx
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