Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions