Question
20.27 As depicted in Fig. P2.27, a water tank consists of a cylinder topped by the frustum of a cone. Develop a wellstructured function in
20.27 As depicted in Fig. P2.27, a water tank consists of a cylinder topped by the frustum of a cone. Develop a wellstructured function in the high-level language or macro language of your choice to compute the volume given the water level h (m) above the tanks bottom. Design the function so that it returns a value of zero for negative hs and the value of the maximum fi lled volume for hs greater than the tanks maximum depth. Given the following parameters, H1 5 10 m, r1 5 4 m, H2 5 5 m, and r2 5 6.5 m, test your function by using it to compute the volumes and generate a graph of the volume as a function of level from h 5 21 to 16 m.
This is for question #2.27
54 PROGRAMMING AND SOFTWARE Develop a well-structured pseudocode function to compute y as a function of t. Note that if the user enters a negative value of t or ilf the rocket has hit the ground (y 0) then return a value of zero for y. Also, the function should be invoked in the calling program as height (t). Write the algorithm as (a) pseudocode, or (b) in the high-level language of your choice. 20.27 As depicted in Fig. P2.27, a water tank consists ofa cylinder topped by the frustum of a cone. Develop a well structured function in the high-level language or macro lan- guage of your choice to compute the volume given the water level h (m) above the tank's bottom. Design the function so that it returns a value of zero for negative h's and the value of the maximum filled volume for h's greater than the tank's maxi mum depth. Given the following parameters, H10 m,r 4m, H2 5 m, and r2-6.5 m, test your function by using it to compute the volumes and generate a graph of the volume as a function of level from h =-1 to 16 m. H. FIGURE P2.27Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started