Question: Write a C++ program which requests and reads three double values. The first are the the diameter and height of a cylindrical bucket, given in
Write a C++ program which requests and reads three double values. The first are the the diameter and height of a cylindrical bucket, given in centimeters. The third is a (constant) fill rate for the bucket, given as milliliters per second. The program then reports the amount of time needed to fill the bucket with water at the stated rate.
The calculation is straightforward. The volume of the bucket is
v=hr2
where r is the radius of the base (half the diameter). The volume, v, is in cubic centimeters. Since a cubic centimeter is a milliliter, you can divide v by the flow rate to get the time for that volume to flow into the bucket.
note: How do I compile the code?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
