设计一个大学教师和学生管理程序,教师包
{
student:input();
cout<<"please yy:";
cin>>yy;
cout<<"please gs:";
cin>>gs;
cout<<"please sjjg:";
cin>>sjjg;
return;
}
void print()
{
student:print();
cout<<setw(10)<<"yy"<<setw(10)<<"gs"<<setw(10)<<"sjjg"<<endl; cout<<setw(10)<<yy<<setw(10)<<gs<<setw(10)<<sjjg<<endl; }
void average()
{
cout<<setw(10)<<"average"<<endl;
cout<<setw(10)<<float(yy+gs+sjjg)/3.0<<endl;
}
private:
int yy;
int gs;
int sjjg;
float aver;
};
class graduate: public student
{
public:
void input()
{
student:input();
cout<<"please zdls:";
cin>>zdls;
cout<<"please yjff:";
cin>>yjff;
return;
}
void print()
{
student:print();
cout<<setw(10)<<"zdls"<<setw(10)<<"yjff"<<endl;