Question: C++ programming: The distance between 2 points (x1, y1) and (x2, y2) in the Cartesian plan is computed using: sqrt((x2 x1)^2 + (y2 y1)^2) 1.

C++ programming: The distance between 2 points (x1, y1) and (x2, y2) in the Cartesian plan is computed using: sqrt((x2 x1)^2 + (y2 y1)^2)

C++ programming: The distance between 2 points (x1, y1) and (x2, y2)

1. 20 points] The distance between 2 points (y and y) in the Cartesian plan is computed using: (a) Write a function getPoint that prompts a user to enter a data point and returns it. (b) Write a function distance that takes as its parameters four numbers that represent two points and returns the distance between them CPSC 1620 Assignment 6 (c) Write a function radius that takes as its parameters four numbers that represent the center and a point on the circle, calls the function distance to find the radius of the circle, and returns the circle's radius. (d) Write a function circumference that takes as its parameters a number that rep- (e) Write a function area that takes as its parameters a number that represents the (f) Write a program that repeatedly prompts the user to enter the center and a point on resents the radius of the circle and returns the circle's circumference. radius of the circle and returns the circle's area. the circle. The program should then output the circle's radius, diameter, circumfer- ence, and area. For example, Enter a data point x and y -- 0 0 Enter a data point x and y -- 4 3 The circle's radius is-5 The circle's diameter is10 The circle's circumference is 31.415 The circle' area is78.537S Try again {Y/N) -- Y Enter a data point x and y-2-1 Enter a data point x and y 3.4 7.5 The cirele' s radius is-8.61452 The circle's diameter is 17.229 The circle's circumference is 54.125 The circle's area is233.131 Try again Y/NN 1. 20 points] The distance between 2 points (y and y) in the Cartesian plan is computed using: (a) Write a function getPoint that prompts a user to enter a data point and returns it. (b) Write a function distance that takes as its parameters four numbers that represent two points and returns the distance between them CPSC 1620 Assignment 6 (c) Write a function radius that takes as its parameters four numbers that represent the center and a point on the circle, calls the function distance to find the radius of the circle, and returns the circle's radius. (d) Write a function circumference that takes as its parameters a number that rep- (e) Write a function area that takes as its parameters a number that represents the (f) Write a program that repeatedly prompts the user to enter the center and a point on resents the radius of the circle and returns the circle's circumference. radius of the circle and returns the circle's area. the circle. The program should then output the circle's radius, diameter, circumfer- ence, and area. For example, Enter a data point x and y -- 0 0 Enter a data point x and y -- 4 3 The circle's radius is-5 The circle's diameter is10 The circle's circumference is 31.415 The circle' area is78.537S Try again {Y/N) -- Y Enter a data point x and y-2-1 Enter a data point x and y 3.4 7.5 The cirele' s radius is-8.61452 The circle's diameter is 17.229 The circle's circumference is 54.125 The circle's area is233.131 Try again Y/NN

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!