Question: This is a modified version of Dr. Howard Silver's programming project (Week 9). Write a C++ program to calculate the time to drain a cylindrical
This is a modified version of Dr. Howard Silver's programming project (Week 9). 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 (specifically for 1,2,4, 6, 8, and 10 ft). The tank has a radius (re) of 2 feet and the drain radius (ra) is 0.3 inch. The gravitational constant (g) is 32.2 feet/sec2 The formula for time to drain the tank is time = ( )2 h/vang where, average velocity, vavg 0.5(2gh)5 in your program, assign the values to the variables , rd, and g. Prompt user to enter the value of h. The program should calculate the value of vavg, and then display time in hours. Using MS Visual Studio, create a project folder called tank and a source code file tank.cpp Use the function pow() in the formulas and NOT sqrt() Set up the output statements (cout) such that the one line display looks like the following: Initial water height (ft.)-1; Time to drain (hrs.)0.44 STEP 1: Analyze the Problem There is only one required output (time in hour of data type double) and one input (initial water height in ft of data type int). All intermediate variables will be assigned a data type of double. STEP 2: Develop a Solution - Develop flowchart or write pseudo code. Display a prompt to enter initial height of water Read a value for the height Calculate average velocity, using the given formulas Display the calculated time Perform a hand calculation of time in hours for height 1ft
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
