各位帮忙改个程序!
//设计日期类,该类能够存储与处理年月日等信息。设计人员类包括string类型的姓名,data类型的出生日期,还包括性别,联系方式和住址等信息。再由人员类派生车学生类和教师类,学生类包括专业,学号,成绩等信息,教师类包括专业,担任课程和技术职称等信息。#include<iostream.h>
class data{
private:
int year;
int day;
int month;
public:
data(int r=0,int d=0,int h=0)
{
year=r;
day=d;
month=h;
}
void show1()const
{
cout<<year<<day<<month<<endl;
}
};
class people{
private:
char name[40];
int phonenum;
char adress[50];
public:
data(char *m=" ",int p,int *a=" ")
{
strcpy[name,m];
strcpy[adress,a];
phonenum=p;
}
void show2()const
{
cout<<name<<adress<<phonenum<<endl;
}
};
class student{
private:
char Professional[20];
char xue[20];
int score;
public:
student(char *pro=" ",char *x,int s=0,int r=0,int d=0,int h=0,char *m=" ",int p,int *a=" "):student_data(r,d,h),student_people(m,p,a)
{
strcpy[Professional,pro];
strcpy[xue,x];
score=s;
}
void show3()const
{
cout<<Professional<<xue<<score<<endl;
student_data.show1();
student_people.show2();
}
};
class teacher{
private:
char course[20];
char zhicheng[20];
public:
teacher(char *c=" ",char *z=" ",int r=0,int d=0,int h=0,char *m=" ",int p,int *a=" "):teacher_data(r,d,h),teacher_people(m,p,a)
{
strcpy[course,c];
strcpy[zhicheng,z];
}
void show4()const
{
cout<<course<<zhicheng<<endl;
teacher_data.show1();
teacher_people.show2();
}};
void main()
{
student my_student("级","级",23,1989,2,43,"级",23,"级");
my_student.show3();
teacher my_teacher("的","第三位",23,34,23,"级",234,"几");
my_teacher.show4();
}