Concept explainers
Figure P2.13 shows a cylindrical tank with a conical base. If the liquid level is quite low in the conical part, the volume is simply the conical volume of liquid. If the liquid level is mid-range in the cylindrical part, the total volume of liquid includes the filled conical part and the partially filled cylindrical part. Write a well-structured function procedure to compute the tank's volume as a function of given values of R and d. Use decisional control structures (like If/Then, ElseIf, Else, End If). Design the function so that it returns the volume for all cases where the depth is less than 3R. Return an error message (“Overtop”) if you overtop the tank, that is,
R | 1 | 1 | 1 | 1 |
d | 0.5 | 1.2 | 3.0 | 3.1 |
FIGURE P2.13
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Package: Numerical Methods For Engineers With 2 Semester Connect Access Card
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageAlgebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal Littell