Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A closer look at functions - C++ C option: (The best grade is a 79%) Write a program to calculate the cost and time it

A closer look at functions - C++

image text in transcribed

C option: (The best grade is a 79%) Write a program to calculate the cost and time it takes to fill a swimming pool . Inputs: Length, Width, and Depth of the pool (This is a gross simplification, since pools are not really rectangular cubes.) Fill rate of the pool in Gallons per minute Calculation functions Write a function to calculate the total cubic feet (Length x Width x Depth) and return the cubic feet. Inputs: Write a function to calculate the number of gallons 1 cubic foot- 7.48051948 US gallons (Create a constant to hold the conversion factor.) Input: Cubic Feet Write a function to calculate the cost to fill the pool as follows o Length, Width, and Depth Return cubic feet o Return Gallons o Calculate 1000's of gallons by dividing the total gallons by 1000 and putting the result in an integer variable Use the following table to generate the cost Monthly Usage)Monthly Rate) Input: Gallons Return Cost to 3,000 gallons $15.50 2.90 per thousand .Call your functions from main0 Outputs bove the 3000 If there is an xcess above 3,000 gallons plus $15.50 (ie 15.50 +2.90 * # . allons o Total cubic feet o Total gallons o Cost o Time to fill in minutes f thousand gallons r 3 thousand A option: (The best grade is a 100%) Note: No B option on this one Combine the functions to calculate the cubic feet and number of gallon. . o Inputs to the function: Length, Width, Depth o Outputs (via reference variables): Cubic Feet, Gallons Example Prototype void PoolSize(float Length, float Width, float Depth, float &CubicFeet, float &Gallons); Write a function that calculate the time to fill as follows o Inputs to the function: Gallons o Outputs (via reference variables): Hours and Minutes Example Prototype void FillTime(float Gallons, float FillRate, ,float &Hours, float &Minutes); Turn in Program listing of your source code, ZIP and screen prints of the following run: Length 25 Width 12 Depth 8 Fill Rate 10 gallons a minute

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

Step: 3

blur-text-image

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

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

U11 Informing Industry: Publicizing Contract Actions 317

Answered: 1 week ago