Home > Back-end >  For the answer!
For the answer!

Time:09-23

#include
#include
using namespace std;
//the Point class Point
The class Point
{
Private:
Double x;
Double y;
Public:
Point (double xv=0, double yv=0). Constructor/* */
Void your setX (double xv);/* set X coordinate */
Void setY (double yv);/* Y */set
Double getX () const;/* get X coordinate */
Double getY () const;/* get Y */
Friend ostream & amp; The operator & lt; <(ostream & amp; Out, const Point & amp; P);//operator & lt; Friend cost & amp; The operator & gt;> (cost & amp; In the Point & amp; P);//operator & gt;> Overloaded
};
Class Plane Plane figure base class/* */
{
Public:
Virtual double length (const)=0;/* * circumference/
Virtual double area (const)=0; Area/* */
};
//class Circle round
The class Circle: public Point, public parts relate
{
Private:
Double radius;
Protected:
The static const double PI;
Public:
Circle (double xv=0, double yv=0, double r=0). Constructor/* */
Void setR (double r);/* * set radius/
Double getR () const;/* * get radius/
Double area () the const; Area/* */
Double length () const;/* * circumference/
Friend ostream & amp; The operator & lt; <(ostream & amp; Out, const Circle & amp; C);//operator & lt; Friend cost & amp; The operator & gt;> (cost & amp; In the Circle & amp; C);//operator & gt;> Overloaded
};

/* please fill in the first part of the answer here */

Void f (Plane const & amp; P)
{
CoutCout}
//the main function
Int main (void)
{
Double d1, d2.
Cin> D1 & gt;> D2.
Point p (d1, d2);
Circle c;

/* please fill in the second part of the answer here */

F (c);
return 0;
}
  • Related