Write a program that prompts the user to specify: The amount of premixed concrete (in cubic yards) ordered The thickness of the patio (in inches) The ratio of length and width Ex. If the ratio is 3 to 2, have the program accept a 3 then a 2. Then compute the ratio using these numbers The program then outputs: The length and width of the patio (in feet). (1 cubic yard = 27 cubic feet.)

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 4E: In this chapter, you learned that although a double and a decimal both hold floating-point numbers,...
icon
Related questions
icon
Concept explainers
Question

This is for C++

 

Instructions

A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to be, say, four inches thick. The length of the patio is to be, say, twice the width.

Write a program that prompts the user to specify:

  1. The amount of premixed concrete (in cubic yards) ordered
  2. The thickness of the patio (in inches)
  3. The ratio of length and width
    • Ex. If the ratio is 3 to 2, have the program accept a 3 then a 2. Then compute the ratio using these numbers

The program then outputs:

  1. The length and width of the patio (in feet). (1 cubic yard = 27 cubic feet.)

To calculate the width, you will need to:

  1. Find the total cubic feet of the concrete
  2. Divide the total cubic feet of concrete by the result of the length to width ratio multiplied by the thickness of the patio, over 12 (inches in a foot)
  3. Square root the answer

To find the square root of a decimal number, include the header file cmath using the statement #include <cmath>, in your program.

The function sqrt, included in this header file, determines the square root of a decimal number. For example, sqrt(16.0) = 4.0.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operators
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr