6. The water tower shown is comprised of a cylindrical lower portion, and a sphe
ID: 3900635 • Letter: 6
Question
6. The water tower shown is comprised of a cylindrical lower portion, and a spherical upper portion. The dimensions of each portion are shown in the diagram. Inside the tank is a float that indicates the level of water (denoted by height, h.) Ask the user to enter the water height, h, and use this information to calculate the total volume of water in the tower. diamater diameler 20m You can easily look up the Volume of a cylinder, but here is how to calculate the volume of a portion of a sphere (a "spherical cap"): Where: hd depth of water in the sphereExplanation / Answer
Hello student!
Here goes the matlab code.
%% starts here
pi = 3.1416;
diameterCyl = 20;
hCyl = 15;
dSph = 25;
hd = input('Enter height of the water');
R = dSph/2; % (Radius of sphere);
r = sqrt(2*R*hd - hd*hd); % radius of the water line.
V = hd*pi*(3*r*r + hd*hd)/6;
fprintf('The volume of the figure will be : %d', V);
%% ends here
Test case / Output :
Enter height of the water 5
The volume of the figure will be : 8.508500e+02
Thank you.
Feel free to ask anything
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.