![數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì) 員工信息管理系統(tǒng)_第1頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-3/17/dd50bb94-227e-404f-8e8c-98db89bfd47d/dd50bb94-227e-404f-8e8c-98db89bfd47d1.gif)
![數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì) 員工信息管理系統(tǒng)_第2頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-3/17/dd50bb94-227e-404f-8e8c-98db89bfd47d/dd50bb94-227e-404f-8e8c-98db89bfd47d2.gif)
![數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì) 員工信息管理系統(tǒng)_第3頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-3/17/dd50bb94-227e-404f-8e8c-98db89bfd47d/dd50bb94-227e-404f-8e8c-98db89bfd47d3.gif)
![數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì) 員工信息管理系統(tǒng)_第4頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-3/17/dd50bb94-227e-404f-8e8c-98db89bfd47d/dd50bb94-227e-404f-8e8c-98db89bfd47d4.gif)
![數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì) 員工信息管理系統(tǒng)_第5頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-3/17/dd50bb94-227e-404f-8e8c-98db89bfd47d/dd50bb94-227e-404f-8e8c-98db89bfd47d5.gif)
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 成 績(jī)12信計(jì)2013-2014(一)數(shù) 據(jù) 結(jié) 構(gòu) 課 程 設(shè) 計(jì)設(shè)計(jì)題目 員工信息管理系統(tǒng) 設(shè)計(jì)時(shí)間 2014.1.62014.1.10 學(xué)生姓名 葛考 學(xué)生學(xué)號(hào) 20120402127 所在班級(jí) 12精算 指導(dǎo)教師 劉 風(fēng) 華 徐州工程學(xué)院數(shù)學(xué)與物理科學(xué)學(xué)院題目 員工信息管理系統(tǒng) 一、 需求分析員工信息管理系統(tǒng)設(shè)計(jì),具體功能如下:1、系統(tǒng)以菜單方式工作,應(yīng)為用戶提供清晰的使用提示,依據(jù)用戶的選擇來(lái)進(jìn)行各種處理,并且在此過(guò)程中能夠盡可能的兼容用戶使用過(guò)程中的輸入異常情況。2、員工信息錄入系統(tǒng)(員工信息用文件保存),注意員工按員工編號(hào)進(jìn)行區(qū)分,即每個(gè)員工的員工編號(hào)都是唯一的,不允許出現(xiàn)兩個(gè)
2、員工或員工編號(hào)相同的情況。3、可對(duì)員工信息進(jìn)行查詢,具體分為:按姓名查詢、按員工號(hào)查詢、按生日查詢;4、可對(duì)員工信息進(jìn)行刪除;5、可對(duì)員工信息進(jìn)行修改,但應(yīng)注意員工號(hào)不能修改,修改應(yīng)逐個(gè)進(jìn)行,一個(gè)員工記錄的更改不應(yīng)影響其他的員工記錄;6、可對(duì)全部的員工信息進(jìn)行顯示v(員工信息瀏覽),注意員工信息的顯示規(guī)范;員工信息應(yīng)包括姓名、員工編號(hào)、性別、年齡、生日、學(xué)歷、職務(wù)、聯(lián)系電話、住址。二、概要設(shè)計(jì)2.1、抽象數(shù)據(jù)類型ADT List數(shù)據(jù)對(duì)象:D=ai|aiElemSet,i=1,2,n,n=0數(shù)據(jù)關(guān)系:R1=|ai-1,aiD,i=1,2,n基本操作:Init List(&L);操作結(jié)果:構(gòu)造一個(gè)
3、空的線性表L。DestroyList(&L);初始條件:線性表L存在。操作結(jié)果:銷毀線性表L。LocateElem(L,I,&e);初始條件:線性表L存在,1inext;printf(n按回車鍵返回主菜單n);gets(lj);四、調(diào)試分析4.1、時(shí)間復(fù)雜度分析在源程序的各個(gè)模塊,時(shí)間復(fù)雜讀為,并且隨著輸入信息量的增加,從而時(shí)間復(fù)雜度也逐漸增加。4.2、問(wèn)題解決在程序設(shè)計(jì)過(guò)程中,本程序采用兩種方式進(jìn)行數(shù)據(jù)輸入,一種是由用戶手動(dòng)輸入數(shù)據(jù),另一種是由文本文件數(shù)據(jù)導(dǎo)入1的方式。但在文本導(dǎo)入過(guò)程中,導(dǎo)入的是二進(jìn)制文件,但由于復(fù)雜程度較高,從而根據(jù)所查資料進(jìn)行修改,采用導(dǎo)入文本文件。在結(jié)果輸出上,由于輸
4、出的是黑屏,所以經(jīng)過(guò)查閱資料,運(yùn)用函數(shù)對(duì)輸出結(jié)果的頁(yè)面進(jìn)行修飾。4.3、設(shè)計(jì)收獲在做實(shí)驗(yàn)前,一定要將課本上的知識(shí)吃透,因?yàn)檫@是做實(shí)驗(yàn)的基礎(chǔ),否則,在做設(shè)計(jì)程序?qū)嶒?yàn)時(shí),這將使你做的難度加大,浪費(fèi)寶貴的時(shí)間,使你事倍功半。做實(shí)驗(yàn)時(shí),一定要親力親為,務(wù)必要將每個(gè)步驟,每個(gè)細(xì)節(jié)弄清楚,弄明白。實(shí)驗(yàn)后,還要復(fù)習(xí),思考,這樣,你的印象才深刻,記得才牢固,否則,過(guò)后不久你就會(huì)忘得一干二凈,這還不如不做。通過(guò)這次程序設(shè)計(jì)的實(shí)驗(yàn),使我們學(xué)到了不少實(shí)用的知識(shí),更重要的是,做實(shí)驗(yàn)的過(guò)程,思考問(wèn)題的方法,這與做其他的實(shí)驗(yàn)是通用的,真正使我們們受益匪淺。五、測(cè)試結(jié)果1、菜單函數(shù)的測(cè)試結(jié)果如圖2圖22、信息查詢函數(shù)的測(cè)試
5、結(jié)果如圖3圖33、信息更新函數(shù)測(cè)試結(jié)果如圖4圖4六、用戶使用說(shuō)明本程序?qū)嵲赩B.6.0環(huán)境下通過(guò)編譯并執(zhí)行。用戶根據(jù)提示信息進(jìn)行選擇并操作。七、附錄源程序:#include #include #include #include /清屏函數(shù)頭文件#include #include #include #define LEN sizeof(struct emp)#define DATA employee.txtstruct emplong int num; /編號(hào)char name20; /姓名int age; /年齡char sex4; /性別char birthday10; /生日char te
6、l15;/電話char edu8; /學(xué)歷char pos20; /職務(wù)char add30; /住址struct emp *next;struct emp *head=NULL;int t=0;void menu();void gengxin();void tianjia();void insert(struct emp *em);void display(struct emp *p);void liebiao();void chaxun();void bianhao();void shengri();void xingming();void readDate();void writeDat
7、e();void freeAll();void shanchu();void change();void devise(struct emp *p);void main()struct emp *head=NULL;head=(struct emp *)malloc(LEN);head-next=NULL;system(color F1);system(mode con: cols=500 lines=1000);readDate();menu();system(cls);printf(nnnnnnnnnnnnnnnnnnn);printf( 謝謝使用,再見(jiàn)n);void menu(void)
8、char i,lj100;int flog;time_t T;struct tm * timenow;time ( &T );timenow = localtime ( &T );flog=0;while(1)system(cls);printf(nnnnn);printf( 員工信息管理系統(tǒng)n);printf( n);printf( n);printf( n);printf( 1.員工信息查詢 n);printf( n);printf( n);printf( n);printf( 2.員工信息更新 n);printf( n);printf( n);printf( n);printf( 3.員
9、工信息列表 n);printf( n);printf( n);printf( n);printf( 0.退出管理系統(tǒng) n);printf( n);printf( n);printf( n);printf( n);printf( %s, asctime (timenow) ); printf(請(qǐng)輸入您的選擇(數(shù)字0-3):n);scanf(%c,&i);gets(lj);if(lj0)i=a;switch(i) case 1:chaxun();break; case 2:gengxin();break; case 3:liebiao();break; case 0:flog=1;break; d
10、efault:printf(輸入有誤,請(qǐng)按回車鍵重新輸入n);gets(lj);break;if(flog)break;void tianjia()struct emp *p,*p1;char lj100;p=NULL;p1=head;printf(請(qǐng)輸入第%d個(gè)員工的信息.n,t+1);p=(struct emp *)malloc(LEN);if(p=NULL)printf(分配空間失敗);exit(0);printf(請(qǐng)輸入員工的編號(hào):n);scanf(%ld,&p-num);while(p1!=NULL)&(p-num!=p1-num)p1=p1-next;if(p1!=NULL)if(
11、p-num=p1-num)printf(編號(hào)已經(jīng)存在,請(qǐng)重新輸入,按回車鍵繼續(xù):n);free(p);gets(lj);getchar();printf(請(qǐng)輸入員工的姓名:n);scanf(%s,p-name);printf(請(qǐng)輸入員工的年齡:n);scanf(%d,&p-age);printf(請(qǐng)輸入員工的性別:n);scanf(%s,p-sex);printf(請(qǐng)輸入員工的出生年月:n);scanf(%s,p-birthday);printf(請(qǐng)輸入員工的電話:n);scanf(%s,p-tel);printf(請(qǐng)輸入員工的學(xué)歷:n);scanf(%s,p-edu);printf(請(qǐng)輸入員
12、工的職務(wù):n);scanf(%s,p-pos);printf(請(qǐng)輸入員工的住址:n);scanf(%s,p-add);insert(p);printf(輸入的員工信息為:n);printf(-:n);printf(編號(hào)tt姓名tt年齡tt性別tt出生年月tt電話tt學(xué)歷tt職務(wù)tt住址:n);display(p);printf(按回車鍵繼續(xù)n);writeDate();gets(lj);getchar();void insert(struct emp *em)struct emp *p0,*p1,*p2;p1=head;p0=em;if(head=NULL)head=p0;p0-next=NU
13、LL;elsewhile(p0-num p1-num)&(p1-next!=NULL)p2=p1;p1=p1-next;if(p0-numnum)if(head=p1)head=p0;elsep2-next=p0;p0-next=p1;elsep1-next=p0;p0-next=NULL;t+;void display(struct emp *p)printf(%ldtt%stt%dtt%stt%stt%stt%stt%stt%sn,p-num,p-name,p-age,p-sex,p-birthday,p-tel,p-edu,p-pos,p-add);void liebiao()char
14、lj100;struct emp *p;p=head;system(cls);if(head=NULL)printf(查找不到信息n);menu();printf(員工信息列表n);printf(編號(hào)tt姓名tt年齡tt性別tt出生年月tt電話tt學(xué)歷tt職務(wù)tt住址 :n);if(head!=NULL)while(p!=NULL)display(p);p=p-next;printf(n按回車鍵返回主菜單n);gets(lj);void chaxun()char i,lj100;int flog;time_t T;struct tm * timenow;time ( &T );timenow
15、= localtime ( &T );flog=0;while(1)system(cls);printf(nnnnn);printf(員工信息查詢系統(tǒng)n);printf( n);printf( n);printf( n);printf( 1.按照編號(hào)查詢 n);printf( n);printf( n);printf( n);printf( 2.按照姓名查詢 n);printf( n);printf( n);printf( n);printf( 3.按照生日查詢 n);printf( n);printf( n);printf( 0.退出管理系統(tǒng) n);printf( n);printf( n)
16、;printf( n);printf(n);printf(%s, asctime (timenow) ); printf(請(qǐng)輸入您的選擇(數(shù)字0-3):n);scanf(%c,&i);gets(lj);if(lj0)i=a;switch(i) case 1:bianhao();break;case 2:xingming();break; case 3:shengri();break;case 0:flog=1;break; default:printf(輸入有誤,請(qǐng)重新輸入n);gets(lj);break;if(flog)break;void bianhao()int number;char
17、 lj100;struct emp *p1;p1=head;printf(請(qǐng)輸入要查詢員工的編號(hào):n);scanf(%d,&number);while(number!=p1-num)&(p1-next!=NULL)p1=p1-next;if(number=p1-num)printf(員工信息查詢n);printf(要查詢的員工信息:n);printf(編號(hào)tt姓名tt年齡tt性別tt出生年月tt電話tt學(xué)歷tt職務(wù)tt住址:n);printf(%ldtt%stt%dtt%stt%stt%stt%stt%stt%sn,p1-num,p1-name,p1-age,p1-sex,p1-birthda
18、y,p1-tel,p1-edu,p1-pos,p1-add);printf(按回車鍵繼續(xù)n);gets(lj);getchar();else if(p1-next=NULL)printf(要查詢的員工信息不存在,按回車鍵返回:n);gets(lj);getchar();void xingming() char ch10;struct emp *p;char lj100;p=head;printf(請(qǐng)輸入要查詢的員工的名字:n);scanf(%s,ch);if(p=NULL)printf(不存在員工記錄,按回車鍵返回.n);gets(lj);getchar();return ;while(str
19、cmp(ch,p-name)&p-next!=NULL)p=p-next;if(!strcmp(ch,p-name)printf(員工信息查詢n);printf(編號(hào)tt姓名tt年齡tt性別tt出生年月tt電話tt學(xué)歷tt職務(wù)tt住址:n);display(p);printf(按回車鍵繼續(xù)n);gets(lj);getchar();else if(p-next=NULL)printf(不存在員工記錄.n);gets(lj);getchar();return;void shengri() char bir20,lj100;struct emp *p;p=head;printf(請(qǐng)輸入要查詢的員工
20、的出生日期:n);scanf(%s,bir);if(p=NULL)printf(不存在員工記錄.按回車鍵返回n);gets(lj);getchar();return ;while(strcmp(bir,p-birthday)&p-next!=NULL)p=p-next;if(!strcmp(bir,p-name)printf(員工信息查詢n);printf(編號(hào)tt姓名tt年齡tt性別tt出生年月tt電話tt學(xué)歷tt職務(wù)tt住址:n);display(p);printf(按回車鍵繼續(xù)n);gets(lj);getchar();else if(p-next=NULL)printf(不存在員工記錄
21、.按回車鍵返回n);gets(lj);getchar();return;void readDate()FILE * fp;struct emp *p1,*p2;fp=fopen(DATA, r);if(!fp)printf(打開文件失敗!按回車鍵繼續(xù)n);getchar();elsefscanf(fp,%dn,&t);head=p1=p2=(struct emp *)malloc(LEN); fscanf(fp,%ldtt%stt%dtt%stt%stt%stt%stt%stt%sn,&p1-num,p1-name,&p1-age,p1-sex,p1-birthday,p1-tel,p1-ed
22、u,p1-pos,p1-add);while(!feof(fp)p1=(struct emp *)malloc(LEN);fscanf(fp,%ldtt%stt%dtt%stt%stt%stt%stt%stt%sn,&p1-num,p1-name,&p1-age,p1-sex,p1-birthday,p1-tel,p1-edu,p1-pos,p1-add);p2-next=p1;p2=p1;p2-next=NULL;fclose(fp);void writeDate()FILE* fp;struct emp *p1;fp=fopen(DATA, w);if(!fp)printf(打開文件失敗!n);getchar();else fprintf(fp,%dn,t);for(p1=head;p1!=NULL;p1=p1-next)fprintf(fp,%ldtt%stt%dtt%stt%stt%stt%stt%stt%sn,p1-num,p1-name,p1-age,p1-sex,p1-birthday,p1-tel,p1-edu,p1-pos,p1-add);fclose(fp);void freeAll()struct emp *p1,*p2;p1=p2=head;while(p1)p2=p1-next;free(p1);p1=p2
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 滅火器的緊急逃生用法
- 概率統(tǒng)計(jì)算法復(fù)習(xí)題
- 屋面工程施工合同細(xì)節(jié)
- 違反工作紀(jì)律整改報(bào)告
- 2025年浙教新版九年級(jí)物理下冊(cè)階段測(cè)試試卷含答案
- 機(jī)器抵押合同(2篇)
- 更換廚房用品合同(2篇)
- 服務(wù)記錄協(xié)議書(2篇)
- 2025年蘇教新版八年級(jí)歷史下冊(cè)月考試卷
- 2025年粵教滬科版選修歷史上冊(cè)階段測(cè)試試卷
- 高一數(shù)學(xué)寒假講義(新人教A專用)【復(fù)習(xí)】第05講 三角函數(shù)(學(xué)生卷)
- 農(nóng)村高中思想政治課時(shí)政教育研究的中期報(bào)告
- 環(huán)衛(wèi)清掃保潔、垃圾清運(yùn)及綠化服務(wù)投標(biāo)方案(技術(shù)標(biāo) )
- 醫(yī)院定崗定編方案文檔
- 4-熔化焊與熱切割作業(yè)基礎(chǔ)知識(shí)(一)
- 2023年200MW儲(chǔ)能電站儲(chǔ)能系統(tǒng)設(shè)計(jì)方案
- 個(gè)人安全與社會(huì)責(zé)任的基本知識(shí)概述
- 建筑裝飾工程計(jì)量與計(jì)價(jià)試題一及答案
- 簡(jiǎn)易勞務(wù)合同電子版
- 明代文學(xué)緒論
- 體育賽事的策劃、組織與實(shí)施 體育賽事利益相關(guān)者
評(píng)論
0/150
提交評(píng)論