工资管理系统源代码c.doc_第1页
工资管理系统源代码c.doc_第2页
工资管理系统源代码c.doc_第3页
工资管理系统源代码c.doc_第4页
工资管理系统源代码c.doc_第5页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

#include#include#include#include#includeusing namespace std;int i;class Person public: void display() cout name; cout num;while(num=0)cout0:num; string name;/ int num;/class Teacher: public Person/public: Teacher() int s=1000; wage = s;butie1=0; void display1(); int wage;/ int time;int butie1;int jintie1;/void Teacher:display1() cout ; Person:display(); cout time;while(time=0)cout0:time;class Leader: public Person/public: Leader() int s=2500; int b=600; wage = s; butie = b;jintie=0; void display1() cout ; Person:display(); int wage;/ int butie;int jintie;/class Jianzhi: public Teacher, public Leader/public: Jianzhi( int b = 500) : Leader() butie = b; void display1() cout ; Teacher:display(); cout time;while(time=0)cout0:time; int butie;/Teacher t100;Leader x100;Jianzhi j100;void show() cout t endl; cout tt 1 endl; cout tt 2 endl; cout tt 3 endl; cout tt 4 endl; cout ;void jiaoshiluru()/ ofstream outfile(.txt, ios:app); if (!outfile) cerr open error! endl; exit(0); int b; cout b; for (i = 0; i b; i+) ti.display1();cout(y(Y)/n(N)c;if(c=Y|c=y) outfile ti.num ti.wage ti.time endl; outfile.close();void Leaderluru()/ ofstream outfile(.txt, ios:app); if (!outfile) cerr open error! endl; exit(0); int b; cout b; for (i = 0; i b; i+) xi.display1(); cout(y(Y)/n(N)c;if(c=Y|c=y) outfile xi.num xi.wage xi.butie endl; void jianzhiluru()/ ofstream outfile(.txt, ios:app); if (!outfile) cerr open error! endl; exit(0); int b; cout b; for (i = 0; i b; i+) ji.display1();cout(y(Y)/n(N)c;if(c=Y|c=y) outfile ji.Teacher:num ji.Teacher:name ji.Leader:wage ji.butie ji.Teacher:time c; if (c = 4) cout endl; system(cls); break; else switch (c) case 1: jiaoshiluru(); break; case 2: Leaderluru(); break; case 3: jianzhiluru(); break; default: cout endl; break; void jiaoshishuchu()/ ifstream infile(.txt, ios:in); int m; for (i = 0; i ti.num ti.wage ti.time;if (ti.num = 0) break; int jintie1; jintie1=ti.time*30; m = ti.wage + jintie1;cout t: setw(8) ti.num setfill( )setw(10) setfill( )setw(10)ti.wagesetfill( )setw(14)jintie1setfill( )setw(12)ti.butie1setfill( )setw(10) m endl; infile.close();void leadershuchu()/ ifstream infile(.txt, ios:in); int m; for (i = 0; i xi.num xi.wage xi.butie; if (xi.num = 0) break; m = xi.wage + xi.butie; cout t setfill( )setw(8)xi.num setfill( )setw(10) setfill( )setw(10)xi.wagesetfill( )setw(14)xi.jintiesetfill( )setw(12)xi.butiesetfill( )setw(10) m endl; infile.close();void jianzhishuchu()/ ifstream infile(.txt, ios:in); int m; for (i = 0; i ji.Teacher:num ji.Teacher:name ji.Leader:wage ji.butie ji.Teacher:time; if (ji.Teacher:num = 0) break;int jintie1;jintie1=ti.time*30; m = ji.Leader:wage + ji.butie +jintie1 ; cout t setfill( )setw(2) ji.Teacher:num setfill( )setw(10) ji.Teacher:namesetfill( )setw(10)ji.Leader:wagesetfill( )setw(14)jintie1setfill( )setw(12)ji.butie setfill( )setw(10) m endl; void shuchu()/ cout tt endl; jiaoshishuchu(); leadershuchu(); jianzhishuchu();void show3() cout t endl; cout tt 1 endl; cout tt 2 endl; cout tt 3 endl; cout tt 4 endl; cout ; void jiaoshichaxun() ifstream infile(.txt, ios:in); string nam; int num; int m, n,x; couttt1.ntt2.; coutx; switch(x) case 1:coutnam; for (i = 0, n = 0; i ti.num ti.wage ti.time; if (ti.num = 0) break; if (=nam) n+; m = ti.wage + (ti.time - 24) * 30;couttt endl; cout t ti.num m endl; if (n =0) cout endl; infile.close();break;case 2: coutnum; for (i = 0, n = 0; i ti.num ti.wage ti.time; if (ti.num = 0) break; if (ti.num=num) n+; m = ti.wage + (ti.time - 24) * 30;couttt endl; cout t ti.num m endl; if (n =0) cout endl; infile.close();break;default:cout!endl;break; void leaderxhaxun()/ ifstream infile(.txt, ios:in); string nam; int num; int m, n,y; couttt1.ntt2.; couty; switch(y) case 1:coutnam; for (i = 0, n = 0; i xi.num xi.wage xi.butie; if (xi.num = 0) break; if (=nam) n+; m = xi.wage + xi.butie;couttt endl; cout t xi.num m endl; if (n =0) cout endl; infile.close();break;case 2: coutnum; for (i = 0, n = 0; i xi.num xi.wage xi.butie; if (xi.num = 0) break; if (xi.num=num) n+; m = xi.wage + xi.butie;couttt endl; cout t xi.num m endl; if (n =0) cout endl; infile.close();break;default:cout!endl;break; void jianzhichaxun()/ ifstream infile(.txt, ios:in); string nam; int num; int m, n,x;couttt1.ntt2.;coutx; switch(x) case 1:coutnam; for (i = 0, n = 0; i ji.Teacher:num ji.Teacher:name ji.Leader:wage ji.butie ji.Teacher:time; if (ji.Teacher:num = 0) break; if (ji.Teacher:name=nam) n+; m = ji.Leader:wage + ji.butie + ji.Teacher:time * 30;couttt endl; cout ji.Teacher:num ji.Teacher:name m endl; if (n =0) cout endl; infile.close();break;case 2: coutnum; for (i = 0, n = 0; i ji.Teacher:num ji.Teacher:name ji.Leader:wage ji.butie ji.Teacher:time; if (ji.Teacher:num = 0) break; if (ji.Teacher:num=num) n+; m = ji.Leader:wage + ji.butie + ji.Teacher:time * 30;couttt endl; cout ji.Teacher:num ji.Teacher:name m endl; if (n =0) cout endl; infile.close();break;default:cout! c; if (c = 4) cout endl; system(cls); break; ; else switch (c) case 1: jiaoshichaxun(); break; case 2: leaderxhaxun(); break; case 3: jianzhichaxun(); break; default: cout endl; break; void show5() cout t endl; cout tt 1 endl; cout tt 2 endl; cout tt 3 endl; cout ;void jiaoshixiugai()/ ifstream infile(.txt, ios:in); string nam; int n, n1, m1 = 0; cout nam; cout n; for (i = 0; i ti.num ti.wage ti.time; if (ti.num = 0) break; m1+; if ( =nam) n1 = ti.time; ti.time = n; n = n1; infile.close(); ofstream outfile(.txt, ios:out); for (i = 0; i m1; i+) outfile ti.num ti.wage ti.time endl; outfile.close();void janzhi2xiugai()/ ifstream infile(.txt, ios:in); int n, n1, n2; string nam; cout nam; cout n2; for (i = 0, n = 0; i ji.Teacher:num ji.Teacher:name ji.Leader:wage ji.butie ji.Teacher:time; if (ji.Teacher:num = 0) break; n+; if (ji.Teacher:name=nam) n1 = ji.Teacher:time; ji.Teacher:time = n2; n2 = n1; infile.close(); ofstream outfile(.txt, ios:out); for (i = 0; i n; i+) outfile ji.Teacher:num ji.Teacher:name ji.Leader:wage ji.butie ji.Teacher:time c; if (c = 3) cout ttt endl; system(cls); break; else switch (c) case 1: jiaoshixiugai(); break; case 2: janzhi2xiugai(); break; default: cout endl; break; void show6() cout t endl; cout t1 endl; cout t2 endl; cout t3 endl; cout t4 endl; cout ;void jiaoshidel()/ ifstream infile(.txt, ios:in); string nam;int num; int n,x; couttt1.ntt2.; coutx; switch(x) case 1:coutnam; for (i = 0, n = 0; i ti.num ti.wage ti.time; if (ti.num = 0) break; if (=nam) n+;ti.num=0;break; if (n =0)cout endl;elsecout!endl; infile.close();break;case 2: coutnum; for (i = 0, n = 0; i ti.num ti.wage ti.time; if (ti.num = 0) break; if (ti.num=num) n+; ti.num=0;break; if (n =0) cout endl;elsecoutendl; infile.close();break;default:cout!endl;break; infile.close(); ofstream outfile(.txt, ios:out); for (i = 0; i 100; i+) if (ti.num != 0) outfile ti.num ti.wage ti.time endl; outfile.close();void leaderdel()/ ifstream infile(.txt, ios:in); string nam;int num; int n,y; couttt1.ntt2.; couty; switch(y) case 1:coutnam; for (i = 0, n = 0; i xi.num xi.wage xi.butie; if (xi.num = 0) break; if (=nam) n+; xi.num=0;break; if (n =0) cout endl;else coutendl; infile.close();break;case 2: coutnum; for (i = 0, n = 0; i xi.num xi.wage xi.butie; if (xi.num = 0) break; if (xi.num=num) n+; xi.num=0;break; if (n =0) cout endl;elsecoutendl; infile.close();break;default:cout!endl;break; infile.close(); ofstream outfile(.txt, ios:out); for (i = 0; i 100; i+) if (xi.num != 0) outfile xi.num xi.wage xi.butie endl; outfile.close();void jianzhid

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论