Question: C++ Write a C++ program to calculate the time to drain a cylindrical water tank for an initial water height ranging from 1 to 10
Write a C++ program to calculate the time to drain a cylindrical water tank for an initial water height ranging from 1 to 10 feet (in increments of 1 ft). The tank has a nominal radius (rt) of 2 feet and the minimum drain radius (rd) is 0.3 inch. The gravitational constant (g) is 32.2 feet/sec2. The formula for time to drain the tank is time2h/vavg where, average velocity, vavg 0.5(2gh) In your program, assign the values to the variable g. Prompt user to enter the value of rt. The program should calculate the value of vavg, for a given value of rd, and then display time in hours. Using MS Visual Studio, create a project folder called tank_mod and a source code file tank_mod.cpp. Use the function pow() in the formulas and NOT sqrt). Set up the output statements (cout) such that the tabular display looks like the following: Specified tank radius-2 ft. Drain radius = 0.3 inch Initial water height (ft. Time to drain (hrs.) 0.44 2 10 Drain radius0.4 inch STEP 1: Analyze the Problem There is only one required output (time in hour of data type double) and one input rt. All intermediate variables will be assigned a data type of double
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
