while(!indata.eof()) {
indata>>secret1;
if((num==num1)&&(strcmp(secret,secret1)==0)) { }
indata>>num1;
y=0; //改变判断变量的值,停止外层循环 break; //终止内层循环
}
indata.close(); // 检验 登入信息
} 数):\\n\
cin>>num;
cout<<\请输入密码(6及6位字符以下):\\n\
ofstream outdata(\outdata< outdata.close(); //将编号及密码保存到number.txt中 cout< cin>>secret; //注册输入编号及密码 else { cout<<\请输入编号(首位为职务代号且为不超过5位数的整 } } ofstream outdata(\ outdata.close(); //清空文件内容 } ofstream outdata1(\outdata1< outdata.close(); //输入编号至info.txt System.cpp #include void Employee::search() { int num; ifstream indata0(\if(indata0==NULL) exit(0); indata0>>num; indata0.close(); //从文件info.txt中提取编号 int num1;char na1[25];int sta1;int mon1;float sal; int mon0; ifstream indata(\if(indata==NULL) exit(0); while(!indata.eof()) char na[25];int sta,mon; cout<<\请依次输入姓名、职务代号及月份(以空格符分隔):\ cin>>na>>sta>>mon; name=na;status=sta;month=mon; //存储姓名、职务、月份 } { } if(indata.eof()) cout<<\以上是你的工资信息!\\n\\n\ indata.close(); indata>>num1>>na1>>sta1>>mon1>>sal; if(num==num1) cout< void Employee::recordinfo() { } void Employee::recordSalary() { ifstream indata(\ indata>>number>>name>>status>>month; indata.close(); //依次输出该雇员的工资信息 ifstream indata1(\if(indata1==NULL) exit(0); while(!indata1.eof()) { indata1>>num1>>na1>>sta1>>mon1>>sal; int num1;char na1[25];int sta1;int mon1;float sal; ofstream outdata(\ outdata< outdata.close(); //添加姓名、职务、月份至存有编号的info.txt中 y; } } if(month!=mon1) cout< //依次输出该雇员的工资信息 cout< outdata<<'\\n'< void Technician::setHour(float x) { } Technician::Technician(float x) { } void Technician::countSalary() { } void Salesman::setsalesnum(float x) { salary=workHour*hourSalary; hourSalary=x; workHour=x; } salesnum=x; Salesman::Salesman(float x) { } void Salesman::countSalary( ) { } void Secretary::setbonus(float x) { } Secretary::Secretary(float x) { } void Secretary::countSalary( ) { } Manager::Manager(float x) { } void TechManager::setgrade(int x) { fixedSalary=x; salary=fixedSalary+bonus; fixedSalary=x; bonus=x; salary=salesnum*getRate; getRate=x;