Question: 1. (50 points) Write a program that reads the values for the radius and height of a solid cylinder using two variables of type double,

 1. (50 points) Write a program that reads the values for

the radius and height of a solid cylinder using two variables of

1. (50 points) Write a program that reads the values for the radius and height of a solid cylinder using two variables of type double, and then calculates the surface area and volume of the cylinder. The program should include the following function. Do not modify the function prototype. void area_volume (double radius, double height, double *pointer_area, double *pointer_volume); The function takes two parameters of double type for the radius and height of the cylinder. The pointer_area parameter points to a variable in which the function will store the area of the circle. The pointer_volume parameter points to a variable in which the function will store the volume of the cylinder. 1) Name your program cylinder.c 2) The main function should ask the user to enter the radius of the cylinder and call the area_volume function to calculate the area and volume. 3) The area_volume function does NOT print the area, volume, or anything else. The area and volume of the cylinder passed back from the two pointer arguments pointer_area and pointer_volume are printed out in the main function. 4) The main function should contain the printf statements that display the area and volume with three decimal digits. Example input/output: Enter the radius of the cylinder: 3.4 Enter the height of the cylinder: 8.2 Output: The volume of the cylinder is 297.798 and the area is 247.809 Programming Style Guidelines The major purpose of programming style guidelines is to make programs easy to read and understand. Good programming style helps make it possible for a person knowledgeable in the application area to quickly read a program and understand how it works. 1. Your program should begin with a comment that briefly summarizes what it does. This comment should also include your name. 2. In most cases, a function should have a brief comment above its definition describing what it does. Other than that, comments should be written only needed in order for a reader to understand what is happening. 3. Information to include in the comment for a function: name of the function purpose of the function, meaning of each parameter, description of return value (if any), description of side effects (if any, such as modifying external variables) 4. Variable names and function names should be sufficiently descriptive that a knowledgeable reader can easily understand what the variable means and what the function does. If this is not possible, comments should be added to make the meaning clear. 5. Use consistent indentation to emphasize block structure. 6. Full line comments inside function bodies should conform to the indentation of the code where they appear. 7. Macro definitions (#define) should be used for defining symbolic names for numeric constants. For example: #define PI 3.141592 8. Use names of moderate length for variables. Most names should be between 2 and 12 letters long. 9. Use underscores to make compound names easier to read: tot_vol or total_volumn is clearer than totalvolumn

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!