Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer in python 19.9 LAB*: Program: Carpet sales Program Specifications Write a program to calculate the cost for replacing carpet for a single room. Carpet

Answer in python

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

19.9 LAB*: Program: Carpet sales Program Specifications Write a program to calculate the cost for replacing carpet for a single room. Carpet is priced by square foot. Total cost includes carpet, labor and sales tax. Dollar values are output with two decimals. For example, print(f'Cost: ${cost:.2f}'). Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. Step 1 (2 pts). Read from input the carpet price per square foot (float), room width (int) and room length (int). Calculate the room area in square feet. Calculate the carpet price based on square feet with an additional 20% for waste. Output square feet and carpet cost. Submit for grading to confirm 1 test passes. Ex: If the input is: 1.10 15 12 the output is: Room: 180 sq ft Carpet: $237.60 Step 2 (2 pts). Calculate the labor cost for installation ($0.75 per actual square foot). Output labor cost. Submit for grading to confirm 2 tests pass. Ex: If the input is: 0.95 10 16 the output is: Room: 160 sq ft Carpet: $182.40 Labor: $120.00 Step 3 (2 pts). Calculate sales tax (7%) on carpet and labor cost. Total cost includes carpet, labor and sales tax. Output sales tax and total cost. Submit for grading to confirm 3 tests pass. Ex: If the input is: 1.25 8 8 the output is: the output is: Room: 64 sq ft Carpet: $96.00 Labor: $48.00 Tax: $10.08 Cost: $154.08 Step 4 (2 pts). Repeat steps 1-3 including additional input for a second order (one order per line). Maintain total sales for both orders. Output information for each order with a heading and then total sales for both orders. Submit for grading to confirm 4 tests pass. Ex: If the input is: 0.95 12 12 1.25 8 18 the output is: Order #1 Room: 144 sq ft Carpet: $164.16 Labor: $108.00 Tax: $19.05 Cost: $291.21 Order #2 Room: 144 sq ft Carpet: $216.00 Labor: $108.00 Tax: $22.68 Cost: $346.68 Total Sales: $637.89 Step 5 (2 pts). Repeat steps 1-3 including additional input for a third order (one order per line). Maintain total sales for all orders. Output information for each order with a heading and then total sales for all orders. Submit for grading to confirm all tests pass. Ex: If the input is: the output is: Order #1 Room: 144 sq ft Carpet: $164.16 Labor: $108.00 Tax: $19.05 Cost: $291.21 Order #2 Room: 144 sq ft Carpet: $216.00 Labor: $108.00 Tax: $22.68 Cost: $346.68 Order #3 Room: 170 sq ft Carpet: $228.48 Labor: $127.50 Tax: $24.92 Cost: $380.90 Total Sales: $1018.79 375418.1072070.qx3zqy7 1: Compare output A 0/2 File "main.py", line 6 a,b,c=(input().split() IndentationError: expected an indented block Input 1.1 15 12 0 0 0 0 0 0 Your output your program produced no output Your output does not contain Room: 180 sq ft Carpet: $237.60 2: Compare output 0/2 File "main.py", line 6 a, b, c= (input()).split() IndentationError: expected an indented block Input 1.2 15 15 000 Your output your program produced no output Your output does not contain Room: 225 sq ft Carpet: $324.00 Labor: $168.75 3: Compare output A 0/2 File "main.py", line 6 a, b, c= (input().split() IndentationError: expected an indented block Input 1.4 12 12 0 0 0 Your output Your program produced no output Your output does not contain Room: 144 sq ft Carpet: $241.92 Labor: $108.00 Tax: $24.49 Cost: $374.41 4: Compare output ^ 0/2 File "main.py", line 6 a,b,c=(input()).split() IndentationError: expected an indented block 13 1.45 1.75 13 12 Input 20 Your output your program produced no output Your output does not contain Total Sales: $1182.15 5: Compare output ^ 0/1 File "main.py", line 6 a,b,c=(input().split() IndentationError: expected an indented block Input 0.95 12 12 1.25 8 18 1.12 10 17 Your output your program produced no output Order #3 Room: 170 sq ft Carpet: $228.48 Labor: $127.50 Tax: $24.92 Cost: $380.90 Your output does not contain Total Sales: $1018.79 6: Compare output A 0/1 File "main.py", line 6 a, b, c= (input()).split() IndentationError: expected an indented block Input 1.2 12 12 0.75 12 20 1.5 12 14 Your output your program produced no output Order #1 Room: 144 sq ft Carpet: $207.36 Labor: $108.00 Tax: $22.08 Cost: $337.44 Order #1 Room: 144 sq ft Carpet: $207.36 Labor: $108.00 Tax: $22.08 Cost: $337.44 Order #2 Room: 240 sq ft Carpet: $216.00 Labor: $180.00 Tax: $27.72 Cost: $423.72 Expected output Order #3 Room: 168 sq ft Carpet: $302.40 Labor: $126.00 Tax: $29.99 Cost: $458.39 Total Sales: $1219.54

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

More Books

Students also viewed these Databases questions

Question

What is Entrepreneur?

Answered: 1 week ago

Question

Which period is known as the chalolithic age ?

Answered: 1 week ago

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago