C++ Code The following formula gives the distance between two points, (x1, y1) and (x2, y2) in the Cartesian plane Given
Posted: Tue Jul 12, 2022 8:15 am
C++ Code
The following formula gives the distance between two points,(x1, y1) and (x2, y2) in the Cartesian plane
Given the center and a point on the circle, you can use thisformula to find the radius of the circle. Write a program thatprompts the user to enter the center and a point on the circle. Theprogram should then output the circle’s radius, diameter,circumference, and area. Your program must have at least thefollowing functions:
calculateRadius: Receives the x-y coordinatesof the center and point on the circle (as input by the user)and calculates the distance between the points. This value isreturned as the radius of the circle.
calculateArea: Receives the radius of acircle, calculates and returns the area of the circle.
calculatePerimeter: Receives theradius of a circle, calculates and returns the perimeter of thecircle.
The output should clearly display the radius, area, andperimeter of the resulting circle.
The following formula gives the distance between two points,(x1, y1) and (x2, y2) in the Cartesian plane
Given the center and a point on the circle, you can use thisformula to find the radius of the circle. Write a program thatprompts the user to enter the center and a point on the circle. Theprogram should then output the circle’s radius, diameter,circumference, and area. Your program must have at least thefollowing functions:
calculateRadius: Receives the x-y coordinatesof the center and point on the circle (as input by the user)and calculates the distance between the points. This value isreturned as the radius of the circle.
calculateArea: Receives the radius of acircle, calculates and returns the area of the circle.
calculatePerimeter: Receives theradius of a circle, calculates and returns the perimeter of thecircle.
The output should clearly display the radius, area, andperimeter of the resulting circle.