Question: Circle (make it simple) DESCRIPTION Important: Make sure that all functions are properly documented with comments. Every function declaration (prototype) should have comments Immediately preceding

Circle
(make it simple)  Circle (make it simple) DESCRIPTION Important: Make sure that all functions
are properly documented with comments. "Every function declaration (prototype) should have comments

DESCRIPTION Important: Make sure that all functions are properly documented with comments. "Every function declaration (prototype) should have comments Immediately preceding it that describe what the function does and how to use It" (from Google's CH Style Guide). The body of each function should contain comments just like we have done for main() in past assignments. Write a program that prompts the user to enter the radius of a circle and the height of a cylinder. The program should then output with 3 digits of precision the circle's radius, diameter, circumference, and area Also, the program should output the volume of the cylinder based on the inputted height and radius After that, prompt the user the enter the x and y coordinates for a point. The program should display whether or not the point is inside or outside of the circle, assuming the circle's center is at (0, 0) Name your source code file circle.cpp. First, define PI as a global constant (assume n = 3.14159) and use this constant in the circumference and area functions. Note: All other variables, should be declared within your functions. Your program must have at least the following functions. Use the names given here a getcircumference. This function takes as its parameter a number that represents the radius of the circle and returns the circle's circumference (fr is the radius, the circumference is 2 ur! b getArea: This function takes as its parameter a number that represents the radius of the circle and returns the circle's area. Il ris the radius, the area is ari) getcylindervolume This function takes two parameters: the radius and the height of the cylinder. The function should return the volume of the cylinder which can be calculated as the circle's area multiplied by the height Call the area function inside this function disInsidePoint This function takes three parameters: (1) the radius and (2) the point's x and y coordinates the function should return true if the point is within (x, y) the circle, otherwise, it should return false (therefore, the return type should be bool). If you think of the point as being on the edge of a new circle, you can compare the radii of the two circles. If the point is on the edge of a circle with the smaller radius, then it must be within the other circle. Note that the radius of a circle can be calculated by considering the x and y coordinates as two sides of a right triangle, calculate the hypotenuse to find the radius. The cmath library has a function call hypot that accepts two values (the lengths of the two sides) and returns the hypotenuse The functions in the list above should NOT get any input from the user or display any information (te, do not use cin or cout) Use main and/or another function to get user input and display the results. Note x1, y1, etc should not be used in your code, because they are too generic to be meaningful pointix. centerx, or edgex, for example, are much better. Sample Output (user input is in yellow) Enter the radius of the circle: 1 Enter the height of the cylinder: 10 Radius 1 Diameter - Circumference - 6.28 Area - cylinder volume 31.4 Check if a point is within a circle centered at (0, @) that has a radius of 1. Enter the x-coordinate of a point: 6.5 Enter the y-coordinate of a point: 0.75 (0.5, 0.75) is within the circle. 2 3.14

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!