Question: What needs to be filled into Circle CPP. 1. Make some member variables to describe a circle Maybe make an operator>> and operator /All the

 What needs to be filled into Circle CPP. 1.Make some membervariables to describe a circle Maybe make an operator>> and operator /All

What needs to be filled into Circle CPP.

1.Make some member variables to describe a circle Maybe make an operator>> and operator

/All the examples below will use the above bob and cindy truct Point \{ float x=0,y=0;// Default position is (0,0) //The "friend" keyword means this function is actually outside the class //(Friend also gives access to private members, but here we don't have any, so it's just an organization thing.) // Point steve = bob - cindy; //steve is {13,16} friend Point operator-(const Point \&lhs, const Point \&rhs) \{ return { lhs. x-rhs. x, lhs y-rhs y}; 3 //Allows us to scale a point towards or away from the origin //Point steve = bob /2; //steve is {1.5,2} friend Point operator/(const Point \&lhs, float scale) \{ return \{lhs.x/scale, lhs.y/scale\}; 3 //How far is this point from the origin? //cout length (bob) distance_to(Point\{float(x), float (y) \}); 3 //You can overload a function so it can take different kinds of parameters... //cout 20.6155 if I did the math right float distance_to(const Point \&rhs) const \{ return hypot (rhs.x-this->x, rhs.y-this->y); \} //This allows you to read a point in from cin, like this - //cin > steve; //Reads two doubles in friend std: :istream\& operator>>(std: :istream\& ins, Point \&rhs) \{ return ins rhs. x rhs.y; \} //This allows you to print a point to cout, like this - //cout

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!