欢迎来到天天文库
浏览记录
ID:10540551
大小:58.00 KB
页数:8页
时间:2018-07-07
《c++工资管理系统程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#includeusingnamespacestd;structWorker_pay{intnum;floatpay[5],basepay,tax,deduct,Actualpay;Worker_pay*next;};classWorker{private:Worker_pay*head;voidPrint(Worker_pay*);Worker_pay*Find(int);public:Worker(){head=NULL;}intListCount();voidAddItem(intnum,floatpay[5]);voidRemoveI
2、tem(int);voidReplace(int);voidList();voidSearch(int);voidActualpay();};intWorker::ListCount(){if(!head)return0;Worker_pay*p=head;intn=0;while(p){n++;p=p->next;}returnn;}voidWorker::AddItem(intnum,floatpay[5]){if(!head){head=newWorker_pay;for(inti=0;i<5;i++)head->pay[i]=pay[i];head->num=num;head->nex
3、t=NULL;return;}Worker_pay*t=head;while(t&&t->num!=num)t=t->next;if(t){cout<<"操作失败;职工编号为"<next)p=p->next;Worker_pay*p1=newWorker_pay;p1->num=num;for(inti=0;i<5;i++)p1->pay[i]=pay[i];p1->next=NULL;p->next=p1;return;}voidWorker::RemoveItem(intnu
4、m){Worker_pay*t=Find(num);if(!t)return;Worker_pay*p=head;if(head==t){head=head->next;deletep;cout<<"成功删除职工编号为"<next!=t)p=p->next;Worker_pay*p1=p->next;p->next=p1->next;deletep1;cout<<"成功删除职工编号为"<5、rker_pay*p=Find(num);if(!p)return;cout<<"请重新输入相应信息"<>p->num>>p->pay[0]>>p->pay[1]>>p->pay[2]>>p->pay[3]>>p->pay[4];return;}voidWorker::Print(Worker_pay*p){cout.precision(8);cout<num<<""<pay[0]<<""<pay[1]<<""<pay[2]<<""<pay[3]<<""<6、>pay[4]<<""<basepay<<""<tax<<""<deduct<<""<Actualpay<next;}cout<7、ndl;return;}voidWorker::Search(intnum){cout<<"Search......"<
5、rker_pay*p=Find(num);if(!p)return;cout<<"请重新输入相应信息"<>p->num>>p->pay[0]>>p->pay[1]>>p->pay[2]>>p->pay[3]>>p->pay[4];return;}voidWorker::Print(Worker_pay*p){cout.precision(8);cout<num<<""<pay[0]<<""<pay[1]<<""<pay[2]<<""<pay[3]<<""<6、>pay[4]<<""<basepay<<""<tax<<""<deduct<<""<Actualpay<next;}cout<7、ndl;return;}voidWorker::Search(intnum){cout<<"Search......"<
6、>pay[4]<<""<basepay<<""<tax<<""<deduct<<""<Actualpay<next;}cout<7、ndl;return;}voidWorker::Search(intnum){cout<<"Search......"<
7、ndl;return;}voidWorker::Search(intnum){cout<<"Search......"<
此文档下载收益归作者所有