求助两个C++程序填空题!!!

1、一个类的声明为:

class A

{

public:

  int GetX();

  void SetX(int f);

private:

  int x;

};

放在a.h头文件中。

然后在a.cpp文件中定义它内部的成员函数:

( )//填写语句1

int A::GetX()

{

return x;

}

( )//填写语句2

{

x = f;

}

2、

定义平面坐标系内的坐标点类:

class Point

{

public:

double GetX() {  return x; }

double GetY() {  return y; }

void SetXY(double a, double b){ x=a; y=b; }

private:

double x;

double y;

};

在主函数中用Point类构建两个坐标点对象A和B,以及两个分别指向这两个坐标点的指针。

void main()

{

    Point A,B;

Point * p1 = &A;

(                          )//填入语句1


A.SetXY(5.0,6.5);   

   cout<< A.GetX()<<endl<<A.GetY()<<endl;


(                                )   //填入语句2,通过指针将B点坐标设置为与A点一样

cout<< B.GetX()<<endl<<B.GetY()<<endl;

}

1、
#include "a.h"
void A::SetX(int f)

2、
Point * p2 = &B;

 p2->SetXY(p1->GetX(),p1->GetY());