[C++] - 面向对象-院校管理系统
注:来源于教科书
/*]
[问题描述]
设计一个院校管理程序.
学生包括姓名,性别,身份证号码,生日,年龄,地址,学号,宿舍号,专业,年级的输入输出;
教师包括姓名,性别,身份证号码,生日,年龄,地址,公寓,每天工作时间,每月薪水,授课专业,所从事的科研名称,所带研究生数目的输入输出;
工人包括姓名,性别,身份证号码,生日,年龄,地址,公寓,每天工作时间,每月薪水,工作类别的输入输出.
[算法分析]
设计一个RECORD类,它包括姓名,性别,身份证号码,生日,年龄,地址的输入输出,然后从RECORD类派生一个STUDENT类,实现学生数据学号,宿舍号,专业,年级的输入输出,从RECORD类派生一个STAFF的中间类,实现公寓,每天工作时间,每月薪水的输入输出,再从STAFF类派生出PROFESSOR类和WORKER类,分别实现教师授课专业,所从事的科研名称,所带研究生数目和工作类别的输入输出.下图反映了这些类之间的关系.
┏━━━━━┓
┃ 类RECORD ┃
┗━━━━━┛
公有继承↙ ↘公有继承
┏━━━━━┓ ┏━━━━━┓
┃ 类STUDENT┃ ┃ 类STAFF ┃
┗━━━━━┛ ┗━━━━━┛
公有继承↙ ↘公有继承
┏━━━━━━┓ ┏━━━━━┓
┃ 类PROFESSOR┃ ┃ 类WORKER ┃
┗━━━━━━┛ ┗━━━━━┛
院校管理系统类图
*/
#include "iostream.h"
#include "string.h"
#include "conio.h"
const char EMPTY='\0';
//RECORD类
class RECORD{
private: //私有部分
char *NAME; //姓名
char *SEX; //性别
char *IDENTIFIER; //身份证号码
char *BIRTHDAY; //生日
char *ADDRESS; //地址
int AGE; //年龄
public: //公有部分
RECORD(); //构造函数
void INSERT_NAME(char *S); //插入姓名
void INSERT_SEX(char *S); //插入性别
void INSERT_IDENTIFIER(char *S); //插入身份证号码
void INSERT_BIRTHDAY(char *S); //插入生日
void INSERT_ADDRESS(char *S); //插入地址
void INSERT_AGE(int A); //插入年龄
void PRINT(); //输出信息
};
//STUDENT子类
class STUDENT:public RECORD{
//This class is derived from RECORD and inherits all the public members of the parent class.
private: //私有部分
char *STUDENT_ID; //学号
char *DORMITORY_NUM; //宿舍号
char *MAJOR; //专业
int LEVEL; //年级
public: //公有部分
STUDENT(); //子类构造函数
void INSERT_STUDENT_ID(char *s); //插入学号
void INSERT_DORMITORY_NUM(char *s); //插入宿舍号
void INSERT_MAJOR(char *s); //插入专业
void INSERT_LEVEL(int A); //插入年级
void PRINT(); //输出信息
};
//STAFF子类
class STAFF:public RECORD{
//STAFF类由RECORD派生并继承父类RECORD的全部公有成员
private: //私有部分
char *DEPARTMENT; //公寓号
int WORKTIME; //工作时间
float SALARY; //薪水(每月)
public: //公有部分
STAFF(); //子类构造函数
void INSERT_DEPARTMENT(char *S); //插入公寓号
void INSERT_WORKTIME(int A); //插入工作时间
void INSERT_SALARY(float A); //插入薪水
void PRINT(); //输出信息
};
//PROFESSOR子类
class PROFESSOR:public STAFF{
//This class is derived from the derived class STAFF.
private: //私有部分
char *TEACH_MAJOR; //授课专业
char *SEARCH_NAME; //科研名称
int GRADUATE_STUDENT_NUM; //所带研究生数目
public: //公有部分
PROFESSOR(); //二级继承类PROFESSOR的构造函数
void INSERT_TEACH_MAJOR(char *S); //插入授课专业
void INSERT_SEARCH_NAME(char *S); //插入科研名称
void INSERT_GRADUATE_STUDENT_NUM(int A); //插入所带研究生数目
void PRINT(); //输出信息
};
//WORKER子类
class WORKER:public STAFF{
//This class is derived from the derived class STAFF.
private: //私有部分
char *WORK_TYPE; //工作类别
public: //公有部分
WORKER(); //二级继承类PROFESSOR的构造函数
void INSERT_WORK_TYPE(char *S); //插入工作类别
void PRINT(); //输出信息
};
/***********************************************************************************/
//定义父类RECORD成员
RECORD::RECORD(){ //构造函数
NAME = EMPTY;
SEX = "MALE";
IDENTIFIER = EMPTY;
BIRTHDAY = EMPTY;
AGE = 0;
};
void RECORD::INSERT_NAME(char *S){ //插入姓名
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
NAME = BUFFER;
};
void RECORD::INSERT_SEX(char *S){ //插入性别
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
SEX = BUFFER;
};
void RECORD::INSERT_IDENTIFIER(char *S){ //插入身份证号码
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
IDENTIFIER = BUFFER;
};
void RECORD::INSERT_BIRTHDAY(char *S){ //插入生日
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
BIRTHDAY = BUFFER;
};
void RECORD::INSERT_ADDRESS(char *S){ //插入地址
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
ADDRESS = BUFFER;
};
void RECORD::INSERT_AGE(int A){ //插入年龄
AGE = A;
};
void RECORD::PRINT(){ //输出信息
cout << NAME << endl
<< SEX << " "
<< IDENTIFIER << " "
<< BIRTHDAY << " "
<< AGE << " "
<< ADDRESS << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//继承自父类RECORD的STUDENT子类成员
STUDENT::STUDENT(){
RECORD:RECORD(); //Use the same constructor as the parent class.
STUDENT::DORMITORY_NUM = EMPTY;
STUDENT::MAJOR = EMPTY;
STUDENT::LEVEL = 0;
};
void STUDENT::INSERT_STUDENT_ID(char *S){ //插入学号
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
STUDENT_ID = BUFFER;
};
void STUDENT::INSERT_DORMITORY_NUM(char *S){ //插入宿舍号
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
DORMITORY_NUM = BUFFER;
};
void STUDENT::INSERT_MAJOR(char *S){ //插入专业
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
MAJOR = BUFFER;
};
void STUDENT::INSERT_LEVEL(int A){ //插入年级
LEVEL = A;
};
void STUDENT::PRINT(){ //输出信息
RECORD::PRINT(); //继承父类RECORD的PRINT()函数
cout << endl;
cout << "STUDENT_ID --> " << STUDENT_ID << endl
<< "DORMITORY_NUM --> " << DORMITORY_NUM << endl
<< "MAJOR --> " << MAJOR << endl
<< "LEVEL --> " << LEVEL << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//继承自父类RECORD的STAFF子类成员
STAFF::STAFF(){ //子类构造函数
RECORD:RECORD(); //继承自父类RECORD的构造函数
DEPARTMENT = EMPTY;
WORKTIME = 0;
SALARY = 300;
};
void STAFF::INSERT_DEPARTMENT(char *S){ //插入公寓号
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
DEPARTMENT = BUFFER;
};
void STAFF::INSERT_WORKTIME(int A){ //插入工作时间
WORKTIME = A;
};
void STAFF::INSERT_SALARY(float A){ //插入薪水
SALARY = A;
};
void STAFF::PRINT(){ //输出信息
RECORD::PRINT(); //继承父类RECORD的PRINT()函数
cout << endl;
cout << "DEPARTMENT --> " << DEPARTMENT << endl
<< "WORK TIME(PER DAY) --> " << WORKTIME << endl
<< "SALARY --> $" << SALARY << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//从继承类STAFF导出的子类PROFESSOR成员
PROFESSOR::PROFESSOR(){ //二级继承类PROFESSOR的构造函数
STAFF:STAFF(); //继承父类STAFF的构造函数
TEACH_MAJOR = EMPTY;
SEARCH_NAME = EMPTY;
GRADUATE_STUDENT_NUM = 0;
};
void PROFESSOR::INSERT_TEACH_MAJOR(char *S){ //插入授课专业
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
TEACH_MAJOR = BUFFER;
};
void PROFESSOR::INSERT_SEARCH_NAME(char *S){ //插入科研名称
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
SEARCH_NAME = BUFFER;
};
void PROFESSOR::INSERT_GRADUATE_STUDENT_NUM(int A){ //插入所带研究生数目
GRADUATE_STUDENT_NUM = A;
};
void PROFESSOR::PRINT(){ //输出信息
STAFF::PRINT(); //调用父类STAFF的PRINT()函数
cout << endl;
cout << "TEACH MAJOR --> " << TEACH_MAJOR << endl
<< "THE PROFESSOR'S SEARCH'S NAME --> " << SEARCH_NAME << endl
<< "THE NUMBER OF PROFESSOR'S GRADUATE STUDENT --> " << GRADUATE_STUDENT_NUM << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//从继承类STAFF导出的子类WORKER成员
WORKER::WORKER(){ //二级继承类PROFESSOR的构造函数
STAFF:STAFF(); //继承父类STAFF的构造函数
WORK_TYPE = "WORKER";
};
void WORKER::INSERT_WORK_TYPE(char *S){ //插入工作类别
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
WORK_TYPE = BUFFER;
};
void WORKER::PRINT(){ //输出信息
STAFF::PRINT(); //调用父类STAFF的PRINT()函数
cout << endl;
cout << "THE WORKER IS A --> " << WORK_TYPE << endl;
};
/***********************************************************************************/
void main(){
STUDENT STU; //定义学生类的实例
PROFESSOR PRO; //定义教授类的实例
WORKER WOR; //定义工人类的实例
/*STUDENT RECORD*/
STU.INSERT_NAME("ZHANG SAN");
STU.INSERT_SEX("FEMALE");
STU.INSERT_IDENTIFIER("123456789");
STU.INSERT_BIRTHDAY("1979/1/1");
STU.INSERT_AGE(20);
STU.INSERT_ADDRESS("BGD 100 BEIJIG");
STU.INSERT_STUDENT_ID("12345");
STU.INSERT_DORMITORY_NUM("8-3-225");
STU.INSERT_MAJOR("COMPUTER SCIENCE");
STU.INSERT_LEVEL(5);
/*PROFESSOR RECORD*/
PRO.INSERT_NAME("LI SI");
PRO.INSERT_SEX("MALE");
PRO.INSERT_IDENTIFIER("11223344");
PRO.INSERT_BIRTHDAY("1940/1/1");
PRO.INSERT_AGE(60);
PRO.INSERT_ADDRESS("111222333 ABCDE CHAOYANG");
PRO.INSERT_DEPARTMENT("3-3-3");
PRO.INSERT_WORKTIME(6);
PRO.INSERT_SALARY(10000);
PRO.INSERT_TEACH_MAJOR("MATH");
PRO.INSERT_SEARCH_NAME("THE METHOD FOR CALCULATING");
PRO.INSERT_GRADUATE_STUDENT_NUM(30);
/*WORKER RECORD*/
WOR.INSERT_NAME("WANG WU");
WOR.INSERT_SEX("MALE");
WOR.INSERT_IDENTIFIER("44556677");
WOR.INSERT_BIRTHDAY("1970/1/1");
WOR.INSERT_AGE(30);
WOR.INSERT_ADDRESS("23456 EFGHI HAIDIAN");
WOR.INSERT_DEPARTMENT("10-3-6");
WOR.INSERT_WORKTIME(10);
WOR.INSERT_SALARY(1000);
WOR.INSERT_WORK_TYPE("CLEARER");
STU.PRINT();
cout << "\n------------------------------------------------------------\n" << endl;
PRO.PRINT();
cout << "\n------------------------------------------------------------\n" << endl;
WOR.PRINT();
}
[问题描述]
设计一个院校管理程序.
学生包括姓名,性别,身份证号码,生日,年龄,地址,学号,宿舍号,专业,年级的输入输出;
教师包括姓名,性别,身份证号码,生日,年龄,地址,公寓,每天工作时间,每月薪水,授课专业,所从事的科研名称,所带研究生数目的输入输出;
工人包括姓名,性别,身份证号码,生日,年龄,地址,公寓,每天工作时间,每月薪水,工作类别的输入输出.
[算法分析]
设计一个RECORD类,它包括姓名,性别,身份证号码,生日,年龄,地址的输入输出,然后从RECORD类派生一个STUDENT类,实现学生数据学号,宿舍号,专业,年级的输入输出,从RECORD类派生一个STAFF的中间类,实现公寓,每天工作时间,每月薪水的输入输出,再从STAFF类派生出PROFESSOR类和WORKER类,分别实现教师授课专业,所从事的科研名称,所带研究生数目和工作类别的输入输出.下图反映了这些类之间的关系.
┏━━━━━┓
┃ 类RECORD ┃
┗━━━━━┛
公有继承↙ ↘公有继承
┏━━━━━┓ ┏━━━━━┓
┃ 类STUDENT┃ ┃ 类STAFF ┃
┗━━━━━┛ ┗━━━━━┛
公有继承↙ ↘公有继承
┏━━━━━━┓ ┏━━━━━┓
┃ 类PROFESSOR┃ ┃ 类WORKER ┃
┗━━━━━━┛ ┗━━━━━┛
院校管理系统类图
*/
#include "iostream.h"
#include "string.h"
#include "conio.h"
const char EMPTY='\0';
//RECORD类
class RECORD{
private: //私有部分
char *NAME; //姓名
char *SEX; //性别
char *IDENTIFIER; //身份证号码
char *BIRTHDAY; //生日
char *ADDRESS; //地址
int AGE; //年龄
public: //公有部分
RECORD(); //构造函数
void INSERT_NAME(char *S); //插入姓名
void INSERT_SEX(char *S); //插入性别
void INSERT_IDENTIFIER(char *S); //插入身份证号码
void INSERT_BIRTHDAY(char *S); //插入生日
void INSERT_ADDRESS(char *S); //插入地址
void INSERT_AGE(int A); //插入年龄
void PRINT(); //输出信息
};
//STUDENT子类
class STUDENT:public RECORD{
//This class is derived from RECORD and inherits all the public members of the parent class.
private: //私有部分
char *STUDENT_ID; //学号
char *DORMITORY_NUM; //宿舍号
char *MAJOR; //专业
int LEVEL; //年级
public: //公有部分
STUDENT(); //子类构造函数
void INSERT_STUDENT_ID(char *s); //插入学号
void INSERT_DORMITORY_NUM(char *s); //插入宿舍号
void INSERT_MAJOR(char *s); //插入专业
void INSERT_LEVEL(int A); //插入年级
void PRINT(); //输出信息
};
//STAFF子类
class STAFF:public RECORD{
//STAFF类由RECORD派生并继承父类RECORD的全部公有成员
private: //私有部分
char *DEPARTMENT; //公寓号
int WORKTIME; //工作时间
float SALARY; //薪水(每月)
public: //公有部分
STAFF(); //子类构造函数
void INSERT_DEPARTMENT(char *S); //插入公寓号
void INSERT_WORKTIME(int A); //插入工作时间
void INSERT_SALARY(float A); //插入薪水
void PRINT(); //输出信息
};
//PROFESSOR子类
class PROFESSOR:public STAFF{
//This class is derived from the derived class STAFF.
private: //私有部分
char *TEACH_MAJOR; //授课专业
char *SEARCH_NAME; //科研名称
int GRADUATE_STUDENT_NUM; //所带研究生数目
public: //公有部分
PROFESSOR(); //二级继承类PROFESSOR的构造函数
void INSERT_TEACH_MAJOR(char *S); //插入授课专业
void INSERT_SEARCH_NAME(char *S); //插入科研名称
void INSERT_GRADUATE_STUDENT_NUM(int A); //插入所带研究生数目
void PRINT(); //输出信息
};
//WORKER子类
class WORKER:public STAFF{
//This class is derived from the derived class STAFF.
private: //私有部分
char *WORK_TYPE; //工作类别
public: //公有部分
WORKER(); //二级继承类PROFESSOR的构造函数
void INSERT_WORK_TYPE(char *S); //插入工作类别
void PRINT(); //输出信息
};
/***********************************************************************************/
//定义父类RECORD成员
RECORD::RECORD(){ //构造函数
NAME = EMPTY;
SEX = "MALE";
IDENTIFIER = EMPTY;
BIRTHDAY = EMPTY;
AGE = 0;
};
void RECORD::INSERT_NAME(char *S){ //插入姓名
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
NAME = BUFFER;
};
void RECORD::INSERT_SEX(char *S){ //插入性别
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
SEX = BUFFER;
};
void RECORD::INSERT_IDENTIFIER(char *S){ //插入身份证号码
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
IDENTIFIER = BUFFER;
};
void RECORD::INSERT_BIRTHDAY(char *S){ //插入生日
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
BIRTHDAY = BUFFER;
};
void RECORD::INSERT_ADDRESS(char *S){ //插入地址
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
ADDRESS = BUFFER;
};
void RECORD::INSERT_AGE(int A){ //插入年龄
AGE = A;
};
void RECORD::PRINT(){ //输出信息
cout << NAME << endl
<< SEX << " "
<< IDENTIFIER << " "
<< BIRTHDAY << " "
<< AGE << " "
<< ADDRESS << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//继承自父类RECORD的STUDENT子类成员
STUDENT::STUDENT(){
RECORD:RECORD(); //Use the same constructor as the parent class.
STUDENT::DORMITORY_NUM = EMPTY;
STUDENT::MAJOR = EMPTY;
STUDENT::LEVEL = 0;
};
void STUDENT::INSERT_STUDENT_ID(char *S){ //插入学号
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
STUDENT_ID = BUFFER;
};
void STUDENT::INSERT_DORMITORY_NUM(char *S){ //插入宿舍号
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
DORMITORY_NUM = BUFFER;
};
void STUDENT::INSERT_MAJOR(char *S){ //插入专业
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
MAJOR = BUFFER;
};
void STUDENT::INSERT_LEVEL(int A){ //插入年级
LEVEL = A;
};
void STUDENT::PRINT(){ //输出信息
RECORD::PRINT(); //继承父类RECORD的PRINT()函数
cout << endl;
cout << "STUDENT_ID --> " << STUDENT_ID << endl
<< "DORMITORY_NUM --> " << DORMITORY_NUM << endl
<< "MAJOR --> " << MAJOR << endl
<< "LEVEL --> " << LEVEL << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//继承自父类RECORD的STAFF子类成员
STAFF::STAFF(){ //子类构造函数
RECORD:RECORD(); //继承自父类RECORD的构造函数
DEPARTMENT = EMPTY;
WORKTIME = 0;
SALARY = 300;
};
void STAFF::INSERT_DEPARTMENT(char *S){ //插入公寓号
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
DEPARTMENT = BUFFER;
};
void STAFF::INSERT_WORKTIME(int A){ //插入工作时间
WORKTIME = A;
};
void STAFF::INSERT_SALARY(float A){ //插入薪水
SALARY = A;
};
void STAFF::PRINT(){ //输出信息
RECORD::PRINT(); //继承父类RECORD的PRINT()函数
cout << endl;
cout << "DEPARTMENT --> " << DEPARTMENT << endl
<< "WORK TIME(PER DAY) --> " << WORKTIME << endl
<< "SALARY --> $" << SALARY << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//从继承类STAFF导出的子类PROFESSOR成员
PROFESSOR::PROFESSOR(){ //二级继承类PROFESSOR的构造函数
STAFF:STAFF(); //继承父类STAFF的构造函数
TEACH_MAJOR = EMPTY;
SEARCH_NAME = EMPTY;
GRADUATE_STUDENT_NUM = 0;
};
void PROFESSOR::INSERT_TEACH_MAJOR(char *S){ //插入授课专业
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
TEACH_MAJOR = BUFFER;
};
void PROFESSOR::INSERT_SEARCH_NAME(char *S){ //插入科研名称
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
SEARCH_NAME = BUFFER;
};
void PROFESSOR::INSERT_GRADUATE_STUDENT_NUM(int A){ //插入所带研究生数目
GRADUATE_STUDENT_NUM = A;
};
void PROFESSOR::PRINT(){ //输出信息
STAFF::PRINT(); //调用父类STAFF的PRINT()函数
cout << endl;
cout << "TEACH MAJOR --> " << TEACH_MAJOR << endl
<< "THE PROFESSOR'S SEARCH'S NAME --> " << SEARCH_NAME << endl
<< "THE NUMBER OF PROFESSOR'S GRADUATE STUDENT --> " << GRADUATE_STUDENT_NUM << endl;
};
/////////////////////////////////////////////////////////////////////////////////////
//从继承类STAFF导出的子类WORKER成员
WORKER::WORKER(){ //二级继承类PROFESSOR的构造函数
STAFF:STAFF(); //继承父类STAFF的构造函数
WORK_TYPE = "WORKER";
};
void WORKER::INSERT_WORK_TYPE(char *S){ //插入工作类别
char *BUFFER;
BUFFER = new char[strlen(S)+1];
strcpy(BUFFER,S);
WORK_TYPE = BUFFER;
};
void WORKER::PRINT(){ //输出信息
STAFF::PRINT(); //调用父类STAFF的PRINT()函数
cout << endl;
cout << "THE WORKER IS A --> " << WORK_TYPE << endl;
};
/***********************************************************************************/
void main(){
STUDENT STU; //定义学生类的实例
PROFESSOR PRO; //定义教授类的实例
WORKER WOR; //定义工人类的实例
/*STUDENT RECORD*/
STU.INSERT_NAME("ZHANG SAN");
STU.INSERT_SEX("FEMALE");
STU.INSERT_IDENTIFIER("123456789");
STU.INSERT_BIRTHDAY("1979/1/1");
STU.INSERT_AGE(20);
STU.INSERT_ADDRESS("BGD 100 BEIJIG");
STU.INSERT_STUDENT_ID("12345");
STU.INSERT_DORMITORY_NUM("8-3-225");
STU.INSERT_MAJOR("COMPUTER SCIENCE");
STU.INSERT_LEVEL(5);
/*PROFESSOR RECORD*/
PRO.INSERT_NAME("LI SI");
PRO.INSERT_SEX("MALE");
PRO.INSERT_IDENTIFIER("11223344");
PRO.INSERT_BIRTHDAY("1940/1/1");
PRO.INSERT_AGE(60);
PRO.INSERT_ADDRESS("111222333 ABCDE CHAOYANG");
PRO.INSERT_DEPARTMENT("3-3-3");
PRO.INSERT_WORKTIME(6);
PRO.INSERT_SALARY(10000);
PRO.INSERT_TEACH_MAJOR("MATH");
PRO.INSERT_SEARCH_NAME("THE METHOD FOR CALCULATING");
PRO.INSERT_GRADUATE_STUDENT_NUM(30);
/*WORKER RECORD*/
WOR.INSERT_NAME("WANG WU");
WOR.INSERT_SEX("MALE");
WOR.INSERT_IDENTIFIER("44556677");
WOR.INSERT_BIRTHDAY("1970/1/1");
WOR.INSERT_AGE(30);
WOR.INSERT_ADDRESS("23456 EFGHI HAIDIAN");
WOR.INSERT_DEPARTMENT("10-3-6");
WOR.INSERT_WORKTIME(10);
WOR.INSERT_SALARY(1000);
WOR.INSERT_WORK_TYPE("CLEARER");
STU.PRINT();
cout << "\n------------------------------------------------------------\n" << endl;
PRO.PRINT();
cout << "\n------------------------------------------------------------\n" << endl;
WOR.PRINT();
}
个性签名:做要做好,做到不三不四不如不做。