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, which can be achieved by executing cout << fixed << setprecision(2); once before all other cout statements. 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. Read from input the carpet price per square foot (double), 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. 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. 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: Room: 64 sq ft Carpet: $96.00 Labor: $48.00 Tax: $10.08 Cost: $154.08 Step 4. 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. 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: 0.95 12 12 1.25 8 18 1.12 10 17 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

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, which can be achieved by executing cout << fixed << setprecision(2); once before all other cout statements.

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. Read from input the carpet price per square foot (double), 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. 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. 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: Room: 64 sq ft Carpet: $96.00 Labor: $48.00 Tax: $10.08 Cost: $154.08

Step 4. 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. 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: 0.95 12 12 1.25 8 18 1.12 10 17

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

1 #include <iostream>
2 #include <iomanip>
3 using namespace std;
4
5 int main() {
in 1000
6
7 /* Type your code here. */
8
9
10 }
11
return 0;
main.cpp
Load default template...
Transcribed Image Text:1 #include <iostream> 2 #include <iomanip> 3 using namespace std; 4 5 int main() { in 1000 6 7 /* Type your code here. */ 8 9 10 } 11 return 0; main.cpp Load default template...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education