Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ and with an output rounding to 2 decimal places. Carpet Company ABC as been asked to lay carpet in a mansion that has

In C++ and with an output rounding to 2 decimal places.

Carpet Company ABC as been asked to lay carpet in a mansion that has only triangular rooms. They want a program written that will allow them to enter the three sides of the room and it will calculate the cost of the carpet. The company sells two types of carpet, nylon and polyester. The nylon carpet costs $23 per square yard, while the polyester carpet costs $18 dollars per square yard.

You are to write a program that allows the employee to enter the length of the three sides (in yards), it then computes the area (look up Heron's Formula) and the cost of the carpet of the room. The cost of nylon and polyester should be declared as constants (above main and all capitals) The program ends with a newline.

Note: Points will be deducted (after the due date) if the constants are not declared

Sample Output #1

Enter the length of the first wall (in yards): 8.25 Enter the length of the second wall (in yards): 5.7 Enter the length of the third wall (in yards): 11.8 Enter the type of carpet (N - nylon, P - polyester): N Receipt ******* Wall lengths: 8.25, 5.70, and 11.80 Area: 21.431110 square yards Carpet Type (N-Nylon, P-Polyester): N Total Cost: $492.92 

Sample Output #2

Enter the length of the first wall (in yards): 4.8 Enter the length of the second wall (in yards): 3.7 Enter the length of the third wall (in yards): 4.95 Enter the type of carpet (N - nylon, P - polyester): P Receipt ******* Wall lengths: 4.80, 3.70, and 4.95 Area: 8.337261 square yards Carpet Type (N-Nylon, P-Polyester): P Total Cost: $150.07

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_2

Step: 3

blur-text-image_3

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

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions

Question

3. Evaluate your listeners and tailor your speech to them

Answered: 1 week ago