Question: Builders Inc. needs a program that allows the companys salesclerks to enter both the diameter of a circular gazebo (in feet), the price of railing

Builders Inc. needs a program that allows the companys salesclerks to enter both the diameter of a circular gazebo (in feet), the price of railing material per foot, and the price of flooring material per square foot. The diameter and the prices may contain decimal places. The program should calculate and display both the circumference of the gazebo, the total price of the railing material, the area of the gazebo floor, and the total price of flooring material. Use a named constant for PI = 3.141593 and the built-in pow() function for the floor area calculation. For your output, use printf() to format the measurements with 1 decimal place and the costs with 2 decimal places (see screenshot below, notice the decimal places line up under each other). Test the program twice. First, with a diameter of 36.5 feet, $2.35 as the price per foot of railing material, and $4.99 as the price per square foot of the flooring material. Then test your code again with a diameter of 42 feet, $3.00 as the price per foot of railing material, and $3.50 as the price per square foot of the flooring material.

Remember that:

circleCircumference = 2 * pi * radius circleArea = pi * radius2

Notice in this output that I didn't display all 3 input values first, because it seemed to me like the flooring cost per square foot fit better with the flooring output. Little things like that are up to you. Just be sure to display all of the input values in output, and make sure the order of display will make sense to the user.

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!