《員工工資管理系統(tǒng)(c語(yǔ)言編程).docx》由會(huì)員分享,可在線(xiàn)閱讀,更多相關(guān)《員工工資管理系統(tǒng)(c語(yǔ)言編程).docx(6頁(yè)珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、#include #include#include#include#define null 0typedef struct Info1char num10;char name10;char depar10;char yfsalary10;char aband10;char tax10;char sfsalary10;struct Info1 *next;Info2;typedef struct Info1 *Info;Info head;void display();void find();void modify();void add();void del();void list();void
2、 listOne(Info s);Info isExists(char *num);void init();void init()head=(Info)malloc(sizeof(Info2);head-next=null;void main()init();while(1)char c;display();scanf(%c,&c);switch(c) case 1:find();break; case 2:add();break;case 3:modify();break;case 4:del();break;case 5:list();break;case 6:printf(tt.退出系統(tǒng)
3、!n);return;default: printf(tt輸入錯(cuò)誤!請(qǐng)按任意鍵返回重新選擇(1-7)n);getchar();void display()printf(nt* 歡迎使用員工信息管理系統(tǒng) *nn);printf(t請(qǐng)選(1-7):n);printf(t=n);printf(tt1.查詢(xún)員工信息n);printf(tt2.錄入員工信息n);printf(tt3.修改員工信息n);printf(tt4.刪除員工信息n);printf(tt6.顯示所有員工信息n);printf(tt7.退出系統(tǒng)n);printf(t=n);printf(t您的選擇是: );void listOne(I
4、nfo p)printf(n該員工信息記錄如下: );printf(n=nn);printf(%-12s%-10s%-10s%-7s%-7s%-10s%-10s%n,員工編號(hào),姓名,部門(mén),應(yīng)付工資,保險(xiǎn),稅金,實(shí)付工資);printf(%-12s%-10s%-10s%-7s%-7s%-10s%-10s%n,p-num,p-name,p-depar,p-yfsalary,p-aband,p-tax,p-sfsalary);Info isExists(char *num)Info p,q;p=head;q=p-next;while(q!=null)if(strcmp(q-num,num)=0)re
5、turn p;p=q;q=p-next;return p;void add()Info p,q;char num10;q=(Info)malloc(sizeof(Info2);printf(tt請(qǐng)輸入員工編號(hào): );scanf(%s,num);p=isExists(num);if (p-next=null)strcpy(q-num,num);printf(tt請(qǐng)輸入員工姓名: );scanf(%s,q-name);printf(tt請(qǐng)輸入該員工的部門(mén): );scanf(%s,q-depar);printf(tt請(qǐng)輸入該員工的應(yīng)付工資金額: );scanf(%s, q-yfsalary);pri
6、ntf(tt請(qǐng)輸入該員工的保險(xiǎn)金額: );scanf(%s, q-aband);printf(tt請(qǐng)輸入該員工的稅金金額: );scanf(%s,q-tax);printf(tt請(qǐng)輸入該員工的實(shí)付工資: );scanf(%s,q-sfsalary);q-next=null;p-next=q;elseprintf(ntt您所輸入的員工編號(hào)以存在! );printf(ntt按任意鍵返回住菜單.);getchar();void del()Info p,q;char num10;if (head-next=null)printf(ntt當(dāng)前還沒(méi)有員工信息記錄,按任意鍵返回主菜單.);getchar()
7、;return;printf(tt請(qǐng)輸入員工編號(hào): );scanf(%s,num);p=isExists(num);q=p-next;if (q!=null)q=q-next;p-next=q;printf(ntt刪除成功! );elseprintf(ntt您所輸入的員工編號(hào)有誤或不存在! );printf(ntt按任意鍵返回主菜單.);getchar();void modify()Info p,q;char num10;if (head-next=null)printf(ntt當(dāng)前還沒(méi)有員工信息記錄,按任意鍵返回主菜單.);getchar();return;printf(tt請(qǐng)輸入員工編號(hào):
8、 );scanf(%s,num);p=isExists(num);q=p-next;if(q!=null)listOne(q);printf(tt請(qǐng)輸入該員工的新姓名: );scanf(%s,q-name);printf(tt請(qǐng)輸入該員工的部門(mén): );scanf(%s,q-depar);printf(tt請(qǐng)輸入該員工的應(yīng)付工資金額: );scanf(%s,q-yfsalary);printf(tt請(qǐng)輸入該員工的保險(xiǎn): );scanf(%s,q-aband);printf(tt請(qǐng)輸入該員工的新稅金金額: );scanf(%s,q-tax);printf(tt請(qǐng)輸入該員工的新實(shí)付工資: );sca
9、nf(%s,q-sfsalary);elseprintf(ntt您所輸入的員工編號(hào)有誤或不存在!);printf(ntt按任意鍵返回主菜單.);getchar();void list()Info p;if (head-next=null)printf(ntt當(dāng)前還沒(méi)有員工信息記錄,按任意鍵返回主菜單.);getchar();return;printf(n所有員工信息記錄如下: );printf(n=nn);printf(%-12s%-10s%-10s%-7s%-7s%-10s%-10s%n,員工編號(hào),姓名,部門(mén),應(yīng)付工資,保險(xiǎn),稅金,實(shí)付金額);p=head-next;while(p!=nul
10、l)printf(%-12s%-10s%-10s%-7s%-7s%-10s%-10s%n,p-num,p-name,p-depar,p-yfsalary,p-aband,p-tax,p-sfsalary);p=p-next;printf(ntt按任意鍵返回主菜單.);getchar();void find()Info p;char num10;if (head-next=null)printf(ntt當(dāng)前還沒(méi)有員工信息記錄,按任意鍵返回主菜單.);getchar();return;printf(tt輸入員工編號(hào): );scanf(%s,num);p=isExists(num);p=p-next;if(p!=null)listOne(p);elseprintf(ntt您所輸入的員工信息有誤或不存在!);printf(ntt按任意鍵返回主菜單.);getchar();