Question: (C++) Create another program using this program as C++ expressions. #include // include header files needed using namespace std; int main() { Declare the Height

(C++) Create another program using this program as C++ expressions.

#include // include header files needed

using namespace std;

int main()

{

Declare the Height of a typical cone as constant, give it the value 30 inches

Declare the diameter of base of cone as constant, give it the value 8 inches

Declare RED_PRICE,the Price per square foot of red paint, as constant give it the value 0.10

Declare BLUE_PRICE, the Price per square foot of blue paint, as constant give it the value 0.15

Declare GREEN_PRICE, the Price per square foot of green paint, as constant give it the value 0.18

Declare PI as a constant with value 3.14159265 // Ratio of circumference to diameter

Declare INCHES_PER_FT as a constant with value 12.0; // Inches in 1 foot

float heightInFt; // Height of the cone in feet

float diamInFt; // Diameter of the cone in feet

float radius; // Radius of the cone in feet

float surfaceArea; // Surface area in square feet

float redCost; // Cost to paint a cone red

float blueCost; // Cost to paint a cone blue

float greenCost; // Cost to paint a cone green

cout

// Find radius and convert dimensions, that in inches, to feet. MAKE SURE YOU //USE CONSTANT INCHES_PER_FT

-----------------????

// Compute surface area of the cone

//surfaceArea = * (

------------------???

// Compute cost for each color

redCost = surfaceArea * RED_PRICE;

blueCost = surfaceArea * BLUE_PRICE;

greenCost = surfaceArea * GREEN_PRICE;

// Print results

cout

cout

cout

.

return 0;

}

  • You must insert the correct formulas as C++ expressions
    • Convert dimensions of cones given in inches to feet
    • Compute the surface area of the cone
    • Compute the cost for each of the color(surfaceArea multiplied by PRICE of each color as shown above)
    • Make sure that you Set up floating point output format and that the results (cost per square foot of each of the paints) are be printed to 3 decimal points as shown below:

(C++)

(C++) Create another program using this program as C++ expressions. #include //

C:\Windows\system32\cmd.exe The surface area is 2.641 sq. ft. The painting cost for red is 0.264 dollars blue is 0.396 dollars green is 0.475 dollars Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!