Write a C program that outputs values of the volume of an elliptically shaped ta
ID: 3765081 • Letter: W
Question
Write a C program that outputs values of the volume of an elliptically shaped tank in a table.
(a) The values of the depth increment by 10 cm each time. Using the equation of an ellipse, find the volume at the specified depths by computing the cross-sectional area using numerical integration. The equation used must be a general one that would work for any function and not just this problem. Do you not use analytical methods.
(b)write a program that determines the depth corresponding to a given volume. The values of the volumes should correspond to multiples of 5 (5, 10, 15, 20, ...). To do so,you must find the equation of the root V(x)=depth. The function V(x) can be deteremined for any x by using numerical integration . The program should determine the roots of an equation for every depth using a root finding alogorithm. This function must also work for the general function and use intgration algorithms.
Explanation / Answer
First of all you want to know the formula for finding the volume of an elliptically shaped tank.
Below, I provided some equations:
Formula of surface area of cylinder:
Surface_area = 2 * Pie * r * (r + h)
Formula of volume of cylinder:
Volume = Pie * r * r * h
Pie = 22/7
Now, I am providing you with a C Program for finding the Volume and Surface area of a cylinder.
#include<stdio.h>
#include<math.h>
int main(){
float r,h;
float surface_area,volume;
printf("Enter size of radius and height of a cylinder : ");
scanf("%f%f",&r,&h);
surface_area = 2 * M_PI * r * (r + h);
volume = M_PI * r * r * h;
printf("Surface area of cylinder is: %.3f",surface_area);
printf(" Volume of cylinder is : %.3f",volume);
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.