Question

Write a C program that outputs values of the volume of an elliptically shaped tank in...

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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("\nVolume of cylinder is : %.3f",volume);

    return 0;

}

Add a comment
Know the answer?
Add Answer to:
Write a C program that outputs values of the volume of an elliptically shaped tank in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The Depth Gauge Problem Liquids are often stored in elliptical storage tanks as shown below. To...

    The Depth Gauge Problem Liquids are often stored in elliptical storage tanks as shown below. To measure the volume of liquid in the tank, a depth gauge (measuring stick) can be used. It is inserted into an opening at the top and the level of liquid on the gauge can be used to determine the amount of liquid in the tank. The tank has width w, height h and length len (all in meters). In the example output shown below,...

  • Maybe it’s easier to imagine the tank on its side so that the depth gauge is...

    Maybe it’s easier to imagine the tank on its side so that the depth gauge is inserted horizontally if you do this you must express the equation as a function of y and integrate that function. Please use the ellipse formula, and compute the volume of liquid by trapezoidal integral and function you altered for the ellipse formula. MUST contain following function: Void trapezoidal_integral (double depth, int n, double width, double height, double length, double *integral_result) Sample output: Enter the...

  • C++ program Write a program that does the following: n main0 1. Prompts the user to...

    C++ program Write a program that does the following: n main0 1. Prompts the user to enter the height, length, and depth of a cube 2. Calls a function that will reduce the size of the height, length, and depth by half (ie. divide them each by 2 arguments must be passed using references handle possible resulting decimal values (ie. 3/2-1.5) 3. Calls another function that will calculate and return the volume of the 'reduced' cube -arguments must be passed...

  • #6 Write a Matlab program that finds numerically all the roots (or the zeros) of the...

    #6 Write a Matlab program that finds numerically all the roots (or the zeros) of the algebraic equation below in the interval 1.0 <=x<=3.0: sqrt(log(x^2+1))=x^2*sin(e^x)+2 Part a) Prompt the user to enter a positive integer number n, defined the range 2<=n<=15, and then verify if the number entered lies within the specifications. Your program must allow the user to reenter the number without the need to rerun the program. Part b) Create a user-defined function for the bisection method(see details...

  • please answer this question with python. Write a program to solve the quadratic equation ax^2 +...

    please answer this question with python. Write a program to solve the quadratic equation ax^2 + bx + c = 0 using the standard quadratic formula x = -b plusminus Squareroot b^2 - 4ac/2a or the alternative formula x = 2c/-b Squareroot b^2 - 4ac. Your program should accept values for the coefficients a, b, and c as input and produce the two roots of the equation as output. Your program should detect when the roots are imaginary, but need...

  • c++ language TECH 1211 Computer Programming Name Test 2 Hands-On-Program B Spring 2020 Write a program...

    c++ language TECH 1211 Computer Programming Name Test 2 Hands-On-Program B Spring 2020 Write a program that uses the quadratic formula to solve quadratic equations. Background Given the format for a quadratic equations: aX? +BX+C =0 The coefficient of the X term is the number a. The coefficient of the X term is the number b. The value of c is any non-zero constant. These values can be positive, negative or zero. You can find the solution to this equation...

  • You must write a C program that prompts the user for two numbers (no command line...

    You must write a C program that prompts the user for two numbers (no command line input) and multiplies them together using “a la russe” multiplication. The program must display your banner logo as part of a prompt to the user. The valid range of values is 0 to 6000. You may assume that the user will always enter numerical decimal format values. Your program should check this numerical range (including checking for negative numbers) and reprompt the user for...

  • Write a program in C++ that gives the temperature of earth at a depth. It must...

    Write a program in C++ that gives the temperature of earth at a depth. It must be in C++ and follow the information below: Problem description Write a program to take a depth in kilometers inside the earth as input data; calculate and display the temperature at this depth in both degrees Celsius and degree Fahrenheit. The formulas are: Celsius temperature at depth in km: celsius = 10 x depth(km) + 20 Convert celsius to fahrenheit: fahrenheit = 1.8 x...

  • C++ 3. Write a program that reads integers from a file, sums the values and calculates...

    C++ 3. Write a program that reads integers from a file, sums the values and calculates the average. a. Write a value-returning function that opens an input file named in File txt. You may "hard-code" the file name, i.e., you do not need to ask the user for the file name. The function should check the file state of the input file and return a value indicating success or failure. Main should check the returned value and if the file...

  • A quadratic equation is generally represented as, ax^2 + bx + c The root(s) of the...

    A quadratic equation is generally represented as, ax^2 + bx + c The root(s) of the above quadratic equation is computed using the following formula, root1 = (-b + sqrt(D))/ 2a root2 = (-b - sqrt(D))/2a Where D is the discriminant of the quadratic equation and is computed as, D = b^2 - 4ac Given the value of D, the roots of a quadratic equation can be categorized as follows, D > 0 : Two distinct real roots D =...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT