请根据代码含义,以UML中的类图表示出这五个类的内部成员和相互关系。
classCPerson{public:voidSetSalary(intS);intAge;char*Name;CPerson(char*aName,intaAge);...
class CPerson {
public:
void SetSalary(int S);
int Age;
char* Name;
CPerson(char *aName,int aAge);
virtual ~CPerson();
protected:
void IncAge();
private:
int Salary;
};
class CCoach : public CPerson {
public:
void Guide();
};
class CPlayer : public CPerson {
public:
void Play(CTrainFloor* pTF);
};
class CTrainFloor {
public:
int Width;
int Length;
CTrainFloor();
~CTrainFloor();
};
class CTeam {
public:
void AddPlayer(CPlayer* pPlayer);
CTrainFloor TrainFloor;
CPlayer* Players[5];
CTeam(char* aName);
virtual ~CTeam();
private:
void Trainning(CCoach* pCoach);
int PlayerCnt;
} 展开
public:
void SetSalary(int S);
int Age;
char* Name;
CPerson(char *aName,int aAge);
virtual ~CPerson();
protected:
void IncAge();
private:
int Salary;
};
class CCoach : public CPerson {
public:
void Guide();
};
class CPlayer : public CPerson {
public:
void Play(CTrainFloor* pTF);
};
class CTrainFloor {
public:
int Width;
int Length;
CTrainFloor();
~CTrainFloor();
};
class CTeam {
public:
void AddPlayer(CPlayer* pPlayer);
CTrainFloor TrainFloor;
CPlayer* Players[5];
CTeam(char* aName);
virtual ~CTeam();
private:
void Trainning(CCoach* pCoach);
int PlayerCnt;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询