Can some one Please post a solution to Problem number 6(Programming Exercise) in
ID: 3610990 • Letter: C
Question
Can some one Please post a solution to Problem number 6(Programming Exercise) in chapter 6 from The book C++Programming From Programming Analysis to Design by D.SMalik.The following formula gives the distance between twopoints (x1,y1) and(x2,y2) in the Cartesian plane:
(x2-x1)2 +(y2-y1)2 its the distanceformula..
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 circles radius, diameter,circumference, and area. The program must have at least thefollowing functions:
distance - this function takes as its parameters four numbers thatrepresent two points in the plane and returns the distance betweenthem.
radius - this function takes as its parameters four numbers thatrepresent the center and a point on the circle, calls the function,distance, to find the radius of the circle, and returns the circlesradius.
circumference: this function takes as its parameter a number thatrepresents the radius of the circle and returns the circle'scircumference (if r is the radius, the circumference is2r)
area: this function takes as its parameter a number that representsthe radius of the circle and returns the circles area. (if r is theradius, the area is (r)2)...
assume that =3.1416
and thank you a lot
Explanation / Answer
please rate - thanks #include #include double distance(int, int, int,int); double radius(int,int,int,int ); double circum(double ); double area(double ); int main() {int x1,y1,x2,y2; double rad,diam,circ,areaa; coutx1>>y1; coutx2>>y2; rad=radius(x1,y1,x2,y2); diam=2*rad; circ=circum(rad); areaa=area(rad); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.