Question: Fix syntax errors and debug the following program: File: CylinderVolume.c (Lab 5) Author: Gilbert Arbez, Fal1 2015 Description: Calculates ho the volume changes fo dilferent

Fix syntax errors and debug the following program: Fix syntax errors and debug the following program: File: CylinderVolume.c (Lab 5) Author: Gilbert Arbez, Fal1 2015 Description: Calculates ho the volume changes fo

File: CylinderVolume.c (Lab 5) Author: Gilbert Arbez, Fal1 2015 Description: Calculates ho the volume changes fo dilferent depths in a horizontal cylinder 7 #include 9 #include 11 Define symbolic constant 12 #defineN 1.3 #define-TX 0 // Tndex to row with depth, h, values 14 #define VOL 1X 1 // Index to row with volume values 15 #define NUM-RCWS 2 // number of rows ir. 2D array 16 #de fine TRUE 17 #de fine FALSE, 0 50 / number of points to compute 19 20 21 Definition of a structure type for user input typedef struct double radius; //in m double length; in m 23 24CYLINDER; 26 Prototypes void getDimensions (CYT,INDER*) 28 void compuLeVolumeCYLINDER *, nt n, double [] [n]); 30 Function: main 1 Description Calls getDimensions to get cylinder dimensions from the user, computevolume to fil1 in the matrix containing depth/volume pairs, and displays the contents of the matzix in a table 35 void main( 36 37 3 8 Variable delarations CYLINDER cyl structure variable o cylinder double points NUM RONS] IN N points of depth/volume int ix;i/ for indexing the columns in the 2D array // Get input from user, the cylinder radius and length get.Dimensions (cyl)i // Compute depth/volume points computeVolume (&cyl, N, points) no & for the pcints array 10 42 43 Display results (could have used a function to display the results) / Setup the start of the table printf("The ena nge in liquid volume of the cylinder with radius .2f and length .2f as depth changes is as follows. ", 1 5 4 6 47 48 4 9 50 51 52 cyl.radius, cyl.length) printf "10s 10s1n","Depth", "Volune") printf ("n") Toop to display each column of the table printf ("10.2f %10.2f ", points [H-IX][ix], points [VOL-IX) [ix]}; 54 56 57 5 8 Function: Paranie Lr getDimensions cylPtr- pointer to a CYLINDER structure variable Description: Prompts the user for the dimensions of the cylinder. Ensures the values are >0. File: CylinderVolume.c (Lab 5) Author: Gilbert Arbez, Fal1 2015 Description: Calculates ho the volume changes fo dilferent depths in a horizontal cylinder 7 #include 9 #include 11 Define symbolic constant 12 #defineN 1.3 #define-TX 0 // Tndex to row with depth, h, values 14 #define VOL 1X 1 // Index to row with volume values 15 #define NUM-RCWS 2 // number of rows ir. 2D array 16 #de fine TRUE 17 #de fine FALSE, 0 50 / number of points to compute 19 20 21 Definition of a structure type for user input typedef struct double radius; //in m double length; in m 23 24CYLINDER; 26 Prototypes void getDimensions (CYT,INDER*) 28 void compuLeVolumeCYLINDER *, nt n, double [] [n]); 30 Function: main 1 Description Calls getDimensions to get cylinder dimensions from the user, computevolume to fil1 in the matrix containing depth/volume pairs, and displays the contents of the matzix in a table 35 void main( 36 37 3 8 Variable delarations CYLINDER cyl structure variable o cylinder double points NUM RONS] IN N points of depth/volume int ix;i/ for indexing the columns in the 2D array // Get input from user, the cylinder radius and length get.Dimensions (cyl)i // Compute depth/volume points computeVolume (&cyl, N, points) no & for the pcints array 10 42 43 Display results (could have used a function to display the results) / Setup the start of the table printf("The ena nge in liquid volume of the cylinder with radius .2f and length .2f as depth changes is as follows. ", 1 5 4 6 47 48 4 9 50 51 52 cyl.radius, cyl.length) printf "10s 10s1n","Depth", "Volune") printf ("n") Toop to display each column of the table printf ("10.2f %10.2f ", points [H-IX][ix], points [VOL-IX) [ix]}; 54 56 57 5 8 Function: Paranie Lr getDimensions cylPtr- pointer to a CYLINDER structure variable Description: Prompts the user for the dimensions of the cylinder. Ensures the values are >0

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!