Question: is there any way you could simplify the program starting with the main function on line 20-41 of the given template DATE: /dd/yyyy Author I

is there any way you could simplify the program starting with the main function on line 20-41 of the given template  is there any way you could simplify the program starting with
the main function on line 20-41 of the given template DATE: /dd/yyyy

DATE: /dd/yyyy Author I Code Templates 1 2 AUTHOR SECTION 3 4 ENGR 200.0 5 6 PROGRAM: 7 8 PROGRAM DESCRIPTION 9 10 DESCRIPTION OF VARIABLES 11 NAME TYPE DESCRIPTION 12 13 14 15 16 21 Preprocessor directives 17 sinclude 18 #include 19 20 Main function / 21 int main(void) 22 V1 Declare variables 24 25 / Print headings printf( printf(" FLOW THROUGH VENTURI METER "); "Input volues 31 32 7 Compute *******); 2na 36 37 38 39 / Print output values / printf(" RESULTS"); printf(" ***** / Exit the program returnej 41 will comples Debug length 10 retorch Media INTRODUCTION: Venturi meters are used to measure flow rates by using a converging section of pipe. As the fluid flows through the convergence, the fluid's velocity increases, and the fluid's pressure drops accordingly. Using the Bernoulli equation, the flow rate can be determined. Venturi meters have been used in industry for many years, particularly in water supply applications. Venturi meters are preferred to simpler methods of flow rate measurement (for example, orifice plates) because they cause less pressure loss in the system, saving energy (compressing fluids requires a significant amount of energy). However, they are more susceptible to errors due to deposits at the throat and are more expensive. The cross-sectional area of the pipe can be calculated by whered, is the diameter of the pipe in cm. The cross-sectional area of the throat, then, can be calculated using where d, is the diameter of the throat in cm. The throat-to-pipe diameter ratio is calculated by This ratio, along with the pressure drop h in cm, is used to calculate the discharge rate (cm/sec): For this program, use a constant pressure drop of 5 cm (define this as a preprocessor constant). Also define pi as a preprocessor constant (3.14159). ASSIGNMENT: Write a C program that asks the user to enter the diameter of the pipe in em and the diameter of the throat in cm. Compute and print the corresponding discharge rate of water in cm/sec. Use the "Code Sections.c" template on Blackboard to write your code. Your program output will look like the illustration shown below. Use your PC's cursor to determine the horizontal and vertical spacing for the output format OUTPUT FORMAT: ****** FLOW THROUGH VENTURI METER Enter pipe diameter in cm: Enter throat diameter in cm: x RESULTS Discharge rate - XXXx.xx cm 3/sec

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!