求助
帮忙看一下这个程序哪里出错了。#include <iostream>
#include <string>
using namespace std;
class Base
{
protected:
string name;
int year,month,day;
string bithplace;
public:
Base(string na,int y,int m,int d,string bp)
{
name=na;
year=y;
month=m;
day=d;
bithplace=bp;
}
void SetName()
{
cout<<"请输入姓名:"<<endl;
cin>>name;
}
void SetDate()
{
cout<<"请输入出生年月:"<<endl;
cin>>year;
cin>>month;
cin>>day;
}
void SetBithPlace()
{
cout<<"请输入出生地址:"<<endl;
cin>>bithplace;
}
void GetName(string &)
{
cout<<"name:"<<name<<endl;
}
void GetDate(int &,int &,int &)
{
cout<<"BithDate:"<<year<<"/"<<month<<"/"<<day<<endl;
}
void GetBithPlace(string &)
{
cout<<"BithPlace:"<<bithplace<<endl;
}
};
class AllChil:public Base
{
protected:
char sex;
public:
AllChil(string na,int y,int m,int d,string bp,char s):
Base(na,y,m,d,bp)
{sex=s;}
void SetAllChil(string na,int y,int m,int d,string bp,char s)
{
void SetName();
void SetDate();
void SetBithPlace();
cout<<"请输入性别:"<<endl;
cin>>sex;
}
void GetAllChil(string &,int &,int &,int &,string &,char &)
{
void GetName();
void GetDate();
void GetBithPlace();
cout<<"sex:"<<sex<<endl;
}
};
class Preschool:public AllChil
{
protected:
int age;
public:
Preschool(string na,int y,int m,int d,string bp,char s,int a):
AllChil(na,y,m,d,bp,s)
{age=a;}
void SetPreschool(string na,int y,int m,int d,string bp,char s,int a)
{
void SetAllChil();
cout<<"请输入年龄:"<<endl;
cin>>age;
}
void GetPreschool(string &,int &,int &,int &,string &,char &,int &)
{
void GetAllChil();
cout<<"age:"<<age<<endl;
}
};
class Schoolage:public AllChil
{
protected:
string school;
int num;
public:
Schoolage(string na,int y,int m,int d,string bp,char s,string sc,int n):
AllChil(na,y,m,d,bp,s)
{
school=sc;
num=n;
}
void SetPreschool(string na,int y,int m,int d,string bp,char s,string sc,int n)
{
void SetAllChil();
cout<<"请输入学校:"<<endl;
cin>>school;
cout<<"请输入学号:"<<endl;
cin>>num;
}
void GetSchoolage(string &,int &,int &,int &,string &,char &,string &,int &)
{
void GetAllChil();
cout<<"school:"<<school<<endl;
cout<<"num:"<<num<<endl;
}
};
class Men:public Base
{
protected:
string danw;
float wage;
int tel;
public:
Men(string na,int y,int m,int d,string bp,string dw,float w,int t):
Base(na,y,m,d,bp)
{
danw=dw;
wage=w;
tel=t;
}
void SetMen(string na,int y,int m,int d,string bp,string dw,float w,int t)
{
void SetName();
void SetDate();
void SetBithPlace();
cout<<"请输入单位:"<<endl;
cin>>danw;
cout<<"请输入工资:"<<endl;
cin>>wage;
cout<<"请输入电话:"<<endl;
cin>>tel;
}
void GetMen(string &,int &,int &,int &,string &,string &,float &,int &)
{
void GetName();
void GetDate();
void GetBithPlace();
cout<<"danw:"<<danw<<endl;
cout<<"wage:"<<wage<<endl;
cout<<"tel:"<<tel<<endl;
}
};
class OldMen:public Base
{
protected:
float twage;
string like;
public:
OldMen(string na,int y,int m,int d,string bp,float tw,string l):
Base(na,y,m,d,bp)
{
twage=tw;
like=l;
}
void SetOldMen(string na,int y,int m,int d,string bp,float tw,string l)
{
void SetName();
void SetDate();
void SetBithPlace();
cout<<"请输入退休工资:"<<endl;
cin>>twage;
cout<<"请输入业余爱好:"<<endl;
cin>>like;
}
void GetMen(string &,int &,int &,int &,string &,float &,string &)
{
void GetName();
void GetDate();
void GetBithPlace();
cout<<"twage:"<<twage<<endl;
cout<<"like:"<<like<<endl;
}
};
int main()
{
system("COLOR 2b");
AllChil all("nan",12,2,2,"dsdf",'f');
cout<<"有关监护人信息的输入和输出:"<<endl;
// all.SetAllChil();
//all.GetAllChil();
cout<<"有关学龄前信息的输入和输出:"<<endl;
void SetPreschool();
void GetPreschool();
cout<<"有关学龄期信息的输入和输出:"<<endl;
void SetSchoolage();
void GetSchoolage();
cout<<"有关成人信息的输入和输出:"<<endl;
void SetMen();
void GetMen();
cout<<"有关老年人信息的输入和输出:"<<endl;
void SetOldMen();
void GetOldMen();
return 0;
}