- 5
- 0
- 约9.08千字
- 约 11页
- 2016-12-31 发布于贵州
- 举报
职工管理系统课程设计(源程序)职工管理系统课程设计(源程序)
#includeiostream
#includestring
#includecstdio
#includeprocess.h
using namespace std;
class Crew{
public:
void add();
void show();
void check();
void change();
private:
string name;//职工姓名
string id1;//工作证号
string id2;//身份证号
string birthday;//出生日期
string address;//家庭住址
string telphone;//联系电话
string salary;//工资
static int account;
};
int Crew::account=0;
Crew stiff[256];
void Crew::add(){
string name,id1,id2,birthday,address,telphone,salary;
cout请输入职工的姓名:;
cinname;
cout请输入职工的身份证号:;
cinid1;
cout请输入职工的工作证号:;
cinid2;
cout请输入职工的出生日期:;
cinbirthday;
cout请输入职工的家庭住址:;
cinaddress;
cout请输入职工的联系电话:;
cintelphone;
cout请输入职工的工资:;
cinsalary;
char c;
cout你是否确认输入的信息?(Y/N);
cinc;
if(toupper(c)==Y){
coutname的个人信息保存成功!;
stiff[Crew::account].name=name;
stiff[Crew::account].id1=id1;
stiff[Crew::account].id2=id2;
stiff[Crew::account].birthday=birthday;
stiff[Crew::account].address=address;
stiff[Crew::account].telphone=telphone;
stiff[Crew::account].salary=salary;
Crew::account++;
}
else
cout保存信息操作取消!;
}
void Crew::show(){
cout姓名 身份证号 工作证号 出生日期 ;
cout家庭住址 联系电话 工资;
coutendl;
for(int i=0;i=Crew::account;i++)
{
coutstiff[i].name ;
coutstiff[i].id1 ;
coutstiff[i].id2 ;
coutstiff[i].birthday ;
coutstiff[i].address ;
coutstiff[i].telphone ;
coutstiff[i].salary ;
coutendl;
}
}
void Crew::check(){
cout请输入你要查找的职工姓名:;
string name;
cinname;
int flag=1;
for(int i=0;i=Crew::account;i++){
if( stiff[i].name==name)
{
flag=0;
cout姓名 身份证号 工作证号 出生日期 ;
cout家庭住址 联系电话 工资;
coutendl;
coutstiff[i].name ;
coutstiff[i].id1 ;
coutstiff[i].id2 ;
coutstiff[i].birthday ;
coutstiff[i].address ;
coutstiff[i].telphone ;
coutstiff[i].salary ;
coutendl;
}
原创力文档

文档评论(0)