: Point.Show() Point.Hide(). , Circle.Show() Circle.Hide(). Circle.MoveTo() Point.MoveTo().
?
, , , . , ?
, , , . , . , , . , .
, , . , , , .. . . Point.MoveTo(), Point.Show() Point.Hide(). - Point.MoveTo() Circle.MoveTo().
, , . , . , . , .
, , . , . . .
. , .
++ .
, , . : , , , .
. () . , , , .
, . , . , , . , , , , . , X Y, . . , , , . Show .
, . , , , : " , . ". , , , : " , . ".
MoveTo(). Circle.MoveTo() : MoveTo() . Point.MoveTo(), . . MoveTo() Show(), . Show(), , Show() MoveTo(), , MoveTo().
, Show() MoveTo() : MoveTo() , Show() . , , MoveTo().
, , .
, .
, , , .
, , "" "", ? .
? , , .
.
, , : , , .. , "".
. : , .
, , , switch .
, , , ( ).
switch ' case, , ( case). , , .
, , , . .
, , . ?
, , . , , , (, ), ( ).
virtual . , , . , . , (.. ).
.
class Point
{
...
public:
...
virtual void Show ();
virtual void Hide ();
void MoveTo (int newX, int newY);
};
...
Point
...
class Circle: public Point
{
...
public:
... // MoveTo()
virtual void Show ();
virtual void Hide ();
};
...
Circle
...
, , Circle MoveTo(), Point.
MoveTo() Circle, .
, . . ++ , , , , , . , ,
Point pointObj (100,20); //
Circle circleObj (20,30,10); //
Point *pointPtr; //
pointPtr = & pointObj; //
pointPtr = & circleObj; //
, .
pointPtr = & pointObj;
pointPtr->MoveTo(10,10);
.
pointPtr = & circleObj;
pointPtr -> Expand(12);
, .
pointPtr = & pointObj;
pointPtr->Show(10,10); // Show() pointObj Point
pointPtr = & circleObj;
pointPtr->Show(10,10); // Show() circleObj Circle
, .
JumpFigure(), "" h.
void JumpFigure (Point* AnyFigure, int h)
{
int oldX = AnyFigure->GetX();
int oldY = AnyFigure->GetY();
delay(100); // 0.1
AnyFigure->MoveTo (oldX, oldY-h); // ""
delay(100); // 0.1
AnyFigure->MoveTo (oldX, oldY); //
}
JumpFigure() Point, , Point.
JumpFigure() , ? . JumpFigure() . JumpFigure() , Point. , Point.
GetX(), GetY(), Show() MoveTo() Circle, Point, , Point, Circle.
GetX(), GetY() MoveTo() . , JumpFigure() .
, Show() . Show() Point Circle, JumpFigure() , .
, JumpFigure() , Show() , AnyFigure. Point, Point.Show(), Circle, Circle.Show(). .
, . JumpFigure() , Point, , JumpFigure() .
, , . , , , , . , (Point) , , , , , , , , , , . , Point, , Point . .. , Point , .
, , , Point, Show() Hide() , . ++ .
. , .
virtual _ ( ) = 0;
.
Point.
class Point
{
protected:
int X;
int Y;
Boolean Visible;
public:
int GetX(void) { return X; }
int GetY(void) { return Y; }
Boolean isVisible (){ return Visible;}
Point (int newX =0, int new Y =0);
virtual void Show() = 0; //
virtual void Hide() = 0; //
void MoveTo (int newX, int newY)
{
Hide();
X = newX; Y = newY;
Show();
}
};
Point , , , , Point, .
, , - X, Y Visible .
: , , , .
10.11.2021 - 12:37: - Personalias -> WHO IS WHO - - _. 10.11.2021 - 12:36: - Conscience -> . ? - _. 10.11.2021 - 12:36: , , - Upbringing, Inlightening, Education -> ... - _. 10.11.2021 - 12:35: - Ecology -> - _. 10.11.2021 - 12:34: , - War, Politics and Science -> - _. 10.11.2021 - 12:34: , - War, Politics and Science -> . - _. 10.11.2021 - 12:34: , , - Upbringing, Inlightening, Education -> , - _. 10.11.2021 - 09:18: - New Technologies -> , 5G- - _. 10.11.2021 - 09:18: - Ecology -> - _. 10.11.2021 - 09:16: - Ecology -> - _. 10.11.2021 - 09:15: , , - Upbringing, Inlightening, Education -> - _. 10.11.2021 - 09:13: , , - Upbringing, Inlightening, Education -> - _. |