euler's method to determine water height

The C++ project that I have been assigned states:

Write a program that determines the water height h, as a function of time. The volume in the tank is

V = (1/3)* pi * h*h * (3R - h)

and the velocity of water flowing through the drain is:

dv/dt = -pi * r*r *SQRT(2gh).

Let R(radius of tank) = 30 ft., r(radius of drainpipe) = 0.3 ft, initial h(water in tank) = 50 ft., g(gravitational constant) = 115.8 ft/(min*min), delta t = 0.5 min., final h = 1 ft. Use Euler's method and solve for h and print the results for each interval.

Note: The purpose of this algorithm is to print a calibration table that shows the volume of water in the tank at a given time. It would be useful to have your program flexible for different tanks, i.e., get all necessary information from the user.

Can anyone help me solve this?
I don't think this belongs in Windows Programming. Even more so since you posted the same topic in General C++....

How about you do the best you can with the coding then ask for help rather than giving us THE EXACT WORDING YOUR TEACHER/PROFESSOR GAVE YOU!
Last edited on
Well, excuse me! I am new to this site and I put it in the wrong place. You could be a little less rude!
mrkmrk: you could try doing your own homework :P This forum (like most) is here to offer people help with their CODE, not with their HOMEWORK. A subtle, but important difference.
Topic archived. No new replies allowed.