C++实现简单的职工信息管理系统

2020-01-06 13:41:39王冬梅
  • cout<<" 工资:"<<w[i].salary<<endl;  cout<<" 地址:"<<w[i].address<<endl; 
  • cout<<" 电话:"<<w[i].tel<<endl;  cout<<"***********************************************"<<endl; 
  • }  } 
  • else if(i5==2)  {  
  • for(int i=0;i<count-1;i++)  for(int j=0;j<count-i-1;j++) 
  • if(w[j].salary<w[j+1].salary)  { 
  • worker temp;  temp=w[j]; 
  • w[j]=w[j+1];  w[j+1]=temp; 
  • }  cout<<"按工资降序后的信息如下:"<<endl; 
  • for( i=0;i<count;i++)  { 
  • cout<<"***********************************************"<<endl;  cout<<" 工号:"<<w[i].num<<endl; 
  • cout<<" 姓名:"<<w[i].name<<endl;  cout<<" 性别:"<<w[i].sex<<endl; 
  • cout<<" 学历:"<<w[i].edu<<endl;  cout<<" 年龄:"<<w[i].age<<endl; 
  • cout<<" 工资:"<<w[i].salary<<endl;  cout<<" 地址:"<<w[i].address<<endl; 
  • cout<<" 电话:"<<w[i].tel<<endl;  cout<<"***********************************************"<<endl; 
  • }  } 
  • else if(i5==0)  menu(); 
  • }  void WorkerList::dele() //职工信息删除函数实现 
  • {  if(NUM<=0) 
  • {  cout<<"没有职工信息存入,系统将返回主菜单"<<endl; 
  • menu();  } 
  • cout<<"请输入需要删除信息职工的工号:"<<endl;  string num3; 
  • cin>>num3;  int j=0,k; 
  • int flag=1;  while(flag) 
  • {  for(;j<count;j++) 
  • {  if(num3==w[j].num) 
  • {  flag=0; 
  • k=j;  break; 
  • }  } 
  • if(flag)  { 
  • cout<<"不存在此员工,请重新输入:"<<endl;  j=0;