What are the bugs in this program and what is the debugged code?
File: CyLinderVoLume.c (Lab 5) Author: Gilbert Arbez, Fall 2016 Description: Calculates how the volume changes for different depths in a horizontal cylinder #include
#include #include 10 12 13 14 15 16 17 18 19 20 21 Define symbloic constant #define N #define H-1X 0 //Index to row with depth, h, values #define VOL1X 1 //Index to rows with volume values #define NUM-RONS 2 /umber of rows in 2D array #de fine TRUE #de fine FALSE 50 number of pounts to compute - ! Definition of a structure tyoe for user input typedef struct inm double radius; double Length; inm 23 24 25 26 27 28 29 30 Function: main 31 Description: Calls getDimensions to get cylinder dimensions from the user 32 CYLINDER; Prototypes void getDimensionsCCYLINDER); void computeVolumeCCYLINDER,int n, double n computeVolume to fill in the matrix containing depth/volume pairs and displays the contents of the matrix in a table 34 35 36 int mainCO 38 39 40 41 42 43 Variable declarations CYLINDER cyl; double points[NUM ROWS] [N] N points of depth/volume int ix; /Get input from user, the cylinder radius and length getDimensions(&cyL); structure variable fo cylinder /for indexing the columns in 2D array Compute depth/vo Lume points computeVolume(&cyl, N, points); / no& for the points array Display results Ccould have used a function to display the results) 45 46 Setup the start of table printf("The change in liquid volume of the cylinder with radius %2t nand length %.Zf as depth changes is as follows .vn cyl.radius, cyl.length) 48 49 printf("%10s %10s ","Depth","Volume"); printf(n) Loop to display each column of the table 51 52 53 print f("%10.2f %10.2fM", points[H-IX] [ix], points [VOLIX][M]); 56 Function: getDimenstion:s 57 Parameter 58 59 cylPtr - pointer to a CYLINDER stucture variable Description: Prompts the user for the dimensions of the cylinder. Ensures the values are > 61 File: CyLinderVoLume.c (Lab 5) Author: Gilbert Arbez, Fall 2016 Description: Calculates how the volume changes for different depths in a horizontal cylinder #include #include #include 10 12 13 14 15 16 17 18 19 20 21 Define symbloic constant #define N #define H-1X 0 //Index to row with depth, h, values #define VOL1X 1 //Index to rows with volume values #define NUM-RONS 2 /umber of rows in 2D array #de fine TRUE #de fine FALSE 50 number of pounts to compute - ! Definition of a structure tyoe for user input typedef struct inm double radius; double Length; inm 23 24 25 26 27 28 29 30 Function: main 31 Description: Calls getDimensions to get cylinder dimensions from the user 32 CYLINDER; Prototypes void getDimensionsCCYLINDER); void computeVolumeCCYLINDER,int n, double n computeVolume to fill in the matrix containing depth/volume pairs and displays the contents of the matrix in a table 34 35 36 int mainCO 38 39 40 41 42 43 Variable declarations CYLINDER cyl; double points[NUM ROWS] [N] N points of depth/volume int ix; /Get input from user, the cylinder radius and length getDimensions(&cyL); structure variable fo cylinder /for indexing the columns in 2D array Compute depth/vo Lume points computeVolume(&cyl, N, points); / no& for the points array Display results Ccould have used a function to display the results) 45 46 Setup the start of table printf("The change in liquid volume of the cylinder with radius %2t nand length %.Zf as depth changes is as follows .vn cyl.radius, cyl.length) 48 49 printf("%10s %10s ","Depth","Volume"); printf(n) Loop to display each column of the table 51 52 53 print f("%10.2f %10.2fM", points[H-IX] [ix], points [VOLIX][M]); 56 Function: getDimenstion:s 57 Parameter 58 59 cylPtr - pointer to a CYLINDER stucture variable Description: Prompts the user for the dimensions of the cylinder. Ensures the values are > 61