已閱讀5頁,還剩26頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
面向?qū)ο蟪绦蛟O(shè)計(jì)課程設(shè)計(jì)報(bào)告 企業(yè)人事管理系統(tǒng) 目錄一、 軟件需求分析二、 總體方案設(shè)計(jì)三、 詳細(xì)設(shè)計(jì)四、 程序的調(diào)試與運(yùn)行結(jié)果說明五、 課程設(shè)計(jì)總結(jié)六、 附錄 一、軟件需求分析一、需求分析1、 實(shí)現(xiàn)人員信息的增、刪、改操作,并實(shí)現(xiàn)按姓名、工號進(jìn)行查詢功能,按照部門、工資統(tǒng)計(jì)、排序功能能夠?qū)崿F(xiàn)人員的部門間的調(diào)動功能2、 源文件采用多文件的工程結(jié)構(gòu)3、 數(shù)據(jù)存儲采用多文件形式4、 標(biāo)準(zhǔn)的C+輸入輸出二、 操作手冊運(yùn)行程序后,按1鍵進(jìn)入系統(tǒng),要實(shí)現(xiàn)多種操作只需按照功能菜單上的提示輸入相應(yīng)的數(shù)字選擇即可 二、總體方案設(shè)計(jì)一、系統(tǒng)總共能模塊顯示記錄查找記錄 按編號按姓名按編號按姓名追加信息新建記錄按編號按姓名企業(yè)人員信息表企業(yè)人員信息表二、定義的函數(shù)及說明void deldate() /刪除指定的單個(gè)員工的資料void adperson() /將輸入的資料賦值給相映的數(shù)據(jù)void pprintn() /輸出所有員工的資料people *query() /將系統(tǒng)中的編號與輸入的編號比較people *qu() /將系統(tǒng)中的姓名與輸入的姓名比 void disp() /輸出所有員工的資料void disp2() /輸出指定的單個(gè)員工的資料void peopledata(); /主要功能實(shí)現(xiàn)函數(shù)void main() /主函數(shù)void jiemian1() /界面1,進(jìn)入程序時(shí)輸出void jiemian3() /界面3,程序結(jié)束后輸出qiye() /qiye類的構(gòu)造函數(shù)三、 詳細(xì)設(shè)計(jì)以下為我完成的具體功能函數(shù)及函數(shù)的詳細(xì)分析和所用算法:1、 void deldate()函數(shù)該函數(shù)是刪除指定的單個(gè)員工的資料,以后在其他程序模塊如刪除、修改等都需要調(diào)用void deldate() kg=1;2、void adperson()函數(shù)該函是數(shù)將輸入的資料賦值給相映的數(shù)據(jù)void people:addperson(int b,int a,long int t,char *na,char *dizhi,char *zhiwei) kg=0; bh=b; strcpy(name,na); strcpy(adr,dizhi); strcpy(duty,zhiwei); ID_num=a; salary=t;3、void pprintn()函數(shù)該函數(shù)是輸出所有員工的資料的函數(shù)在如查詢、修改等功能模塊中通過調(diào)用該函數(shù)可實(shí)現(xiàn)顯示所有員工資料的功能void pprintn() if(Getkg()=0) coutsetw(10)bhsetw(10)namesetw(10)ID_numsetw(10)dutysetw(15)salarysetw(15)adrendl;4、 people *query()函數(shù)該函數(shù)實(shí)現(xiàn)的是將系統(tǒng)中的編號與輸入的編號比較功能在新增、刪除和修改模塊中調(diào)用該函數(shù)可實(shí)現(xiàn)判斷該員工是否已經(jīng)存在而在查詢模塊在調(diào)用該函數(shù)可實(shí)現(xiàn)在已存在的記錄中查找該成員的作用people *query(int personid) for(int i=0;i=top;i+) if(mani.GetNo()=personid&mani.Getkg()=0) return &mani;in=i; return NULL; 5、people *qu()函數(shù)該函數(shù)實(shí)現(xiàn)的是將系統(tǒng)中的姓名與輸入的姓名比較功能在新增、刪除和修改模塊中調(diào)用該函數(shù)可實(shí)現(xiàn)判斷該員工是否已經(jīng)存在而在查詢模塊在調(diào)用該函數(shù)可實(shí)現(xiàn)在已存在的記錄中查找該成員的作用people *qw(char na) for(int i=0;i=top;i+) if(strcmp(mani.GetName(),na)=0&mani.Getkg()=0) return &mani;in=i; return NULL; 5、 void disp()函數(shù)該函數(shù)在新增模塊中使用,該函數(shù)通過循環(huán)判斷輸出所有員工資料void disp() for(int i=0;i=top;i+) if(mani.Getkg()=0) if(i%5=0) coutendl; mani.pprintn(); 6、 void disp2()函數(shù)輸出指定的單個(gè)員工的資料void disp2() coutendl; manin.pprintn(); 7、void peopledata();函數(shù)該函數(shù)為菜單函數(shù),通過此函數(shù)進(jìn)行相應(yīng)的操作,首先按1鍵進(jìn)入功能菜單界面,然后進(jìn)行6種選擇,6退出;1新增職工的信息(1、新建;2、增加);2顯示員工信息;3查找員工信息(1、按姓名;2、按編號);4修改員工信息(1、按姓名;2、按編號);5刪除員工信息(1、逐個(gè)刪除2、全部刪除);void qiye:peopledata()/對qiye類的成員函數(shù)peopledata的類外聲名char choice=0; char ch,peoplen20,addr40,dutyt30; int worherbh; int m; int k; people *w;while(choice!=6)coutendlendl; cout 菜單 endl; coutendl; cout 1:新增endl; cout 2:顯示endl; cout 3:查找endl; cout 4:修改endl; cout 5:刪除endl; cout 6:退出endl; coutendlchoice;if(choice=6) /clear();break; switch(choice)case 1: char ch1;system(cls); coutendlt歡迎進(jìn)入新增系統(tǒng)!endlendl; cout1.新建endlendl; cout2.增加endlendl; coutendlch1;if(ch1=1)char chi; cout確定新建?(Y/N)chi; switch(chi) case Y|y:clear(); break; case N|n:goto loop_1b; default:cout輸入錯(cuò)誤,請重新輸入!endl; goto loop_1i; if(ch1!=1&ch1!=2)cout輸入錯(cuò)誤,請重新輸入!endl;goto loop_1;dodocoutendl請輸入員工編號:worherbh; w=query(worherbh);if(w!=NULL)cout錯(cuò)誤:該編號資料已存在,請重新輸入。endl;while(w!=NULL);cout請輸入員工姓名:peoplen; cout身份證號:m; cout職位:dutyt; cout工資:k; cout籍貫:addr; addperson(worherbh,m,k,peoplen,addr,dutyt); coutch;while(ch=y|ch=Y);loop_1b:break;case 2:coutendlsetw(11)所有員工資料:endlendl; coutsetw(10)編號setw(10)姓名setw(10)身份證號setw(10)職位setw(15)工資setw(15)籍貫endl; disp(); coutendl;break; case 3:char xz3; char na10;docoutendl; system(cls); coutt歡迎進(jìn)入查詢系統(tǒng)!endlendl; cout1.按編號查找:endl; cout2.按姓名查找:endl; cout請輸入相應(yīng)的數(shù)字選擇:xz3;switch(xz3)case 1:coutworherbh; w=query(worherbh);if(w=NULL)cout該員工不存在!endlendl;break;coutendlsetw(11)所找員工資料:endlendl; coutsetw(10)編號setw(10)姓名setw(10)身份證號setw(10)職位setw(15)工資setw(15)籍貫pprintn(); coutendl;break; case 2:coutna; w=qu(na);if(w=NULL)cout該員工不存在!endlendl;break;coutendlsetw(11)所找員工資料:endlendl; coutsetw(10)編號setw(10)姓名setw(10)身份證號setw(10)職位setw(15)工資setw(15)籍貫pprintn(); coutendl;break;default:cout輸入錯(cuò)誤,請重新輸入!endl;goto loop_3; cout是否還要繼續(xù)查找(Y/N):endlch;while(ch=y|ch=Y);break;case 4:char choice,peoplen10;docoutendl; system(cls); coutt歡迎進(jìn)入修改系統(tǒng)!endl; coutendl;loop_4:cout1.按員工編號修改:endl; cout2.按員工姓名修改:endl; coutchoice;switch(choice)case 1:coutworherbh; w=query(worherbh);if(w=NULL)cout該員工資料不存在!pprintn(); w-deldate();dodocoutendl請輸入新員工編號:worherbh; w=query(worherbh);if(w!=NULL)cout該編號資料已存在,請重新輸入。endl;while(w!=NULL);cout請輸入員工姓名:peoplen; cout身份證號:m; cout職位:dutyt; cout工資:k; cout籍貫:addr; addperson(worherbh,m,k,peoplen,addr,dutyt); coutch;while(ch=y|ch=Y);break;case 2:coutpeoplen; w=qw(peoplen);if(w=NULL)cout該員工資料不存在!pprintn(); w-deng();dodocoutendl請輸入員工新編號:worherbh; w=query(worherbh);if(w!=NULL)cout該編號資料已存在,請重新輸入.endl;while(w!=NULL);cout請輸入員工姓名:peoplen; cout身份證號:m; cout職位:dutyt; cout工資:k; cout籍貫:addr; addperson(worherbh,m,k,peoplen,addr,dutyt); coutch;while(ch=y|ch=Y);default:cout輸入錯(cuò)誤,請重新輸入!endl; goto loop_4;coutch; coutendl;while(ch=y|ch=Y);break;case 5:char xz5;system(cls); coutt歡迎進(jìn)入刪除系統(tǒng)!endl; cout1.逐個(gè)刪除.endl; cout2.全部刪除.endl; cout請輸入選擇:xz5;switch(xz5)case 1:coutworherbh; w=query(worherbh);if(w=NULL)cout該員工資料不存在!deldate(); cout刪除成功endl; break; case 2: char xz52; cout確定刪除(Y/N)?xz52;switch(xz52)case Y|y:cout刪除成功.endl; clear(); break; case N|n: cout不刪除!endl; break;default:cout輸入錯(cuò)誤,請重新輸入!endl; goto loop_52;break;default:cout:輸入錯(cuò)誤,請重新輸入!endl; goto loop_5;break;default:cout輸入錯(cuò)誤,請重新輸入!endl; goto loop_0;8、void jiemian1()函數(shù)界面1,進(jìn)入程序時(shí)輸出void jiemian1() coutendl; cout 歡迎使用人事管理系統(tǒng)endlendl; coutendl; cout 請按1鍵進(jìn)入系統(tǒng)endlendl; /cout T:退出系統(tǒng)endlendl; coutnnnn; 9、void jiemian3()函數(shù)界面3,程序結(jié)束后輸出void jiemian3() coutendlendl; cout 輸入任意鍵退出; do exit(0); while(1); 10、qiye()函數(shù)qiye類的構(gòu)造函數(shù),將文件以輸入的方式打開,用s給所有員工資料賦初值,并且實(shí)現(xiàn)關(guān)閉文件的作用qiye:qiye()people s; top=-1; fstream file(people.dat,ios:in);while(1)file.read(char *)&s,sizeof(s);if(!file)break;top+; mantop=s; file.close();11、qiye()函數(shù)qiye類的析構(gòu)函數(shù),作用:釋放空間,并將數(shù)據(jù)存入文件中qiye() fstream file(people.dat,ios:out); for(int i=0;i=top;i+) if(mani.Getkg()=0) file.write(char *)&mani,sizeof(mani); file.close(); 四、程序的運(yùn)行結(jié)果及說明1、運(yùn)行程序后可如界面顯示輸入1后進(jìn)入系統(tǒng)2、進(jìn)入系統(tǒng)可如圖顯示菜單界面可通過數(shù)字選擇進(jìn)行相應(yīng)的操作,例如選擇1進(jìn)行公司人員信息的錄入3、按1進(jìn)入新增系統(tǒng)后如圖所示可選擇1、新建2、增加,新建將刪除原有記錄4、選擇1確認(rèn)新建再輸入員工信息,如圖所示5、退出新建按2進(jìn)入增加選項(xiàng)輸入員工信息6、退出增加,進(jìn)入菜單界面,選擇2,顯示所有員工信息五、課程設(shè)計(jì)總結(jié)本次課設(shè)基本上滿足了題目的要求,比如說修改及刪除職工信息等功能都能實(shí)現(xiàn),但從實(shí)驗(yàn)中我仍然發(fā)現(xiàn)了自己的許多不足之處,例如審題不清、邏輯混亂、程序可讀性較差等問題。通過這次課設(shè),不管是在動手能力還是在程序理解能力上我都得到了很大的提高,我很高興可以學(xué)到如此多的知識,總的來說,這次課設(shè)對我來說還是相當(dāng)成功的六、附錄全部代碼#include stdafx.h#include#include #include #include #include class people/員工類char name5;int kg;int bh;int salary; int ID_num; char adr15; char duty10;public:people() char *GetName()return name; int Getkg()return kg; int GetNo()return bh; int Getsalary()return salary; int GetID_num()return ID_num; char *GetAdr()return adr; char *Getduty()return duty; void SetNum(int num)bh=num; void SetID_num(int pxid)pxid=ID_num; void SetName(char na) strcpy(name,na); void SetAdr(char dizhi) strcpy(adr,dizhi); void Setduty(char zhiwei) strcpy(duty,zhiwei); void deldate() kg=1; void addperson(int b,int a,long int t,char *na,char *dizhi,char *zhiwei);void printw() coutsetw(10)編號setw(10)姓名setw(10)身份證號setw(10)職位setw(15)工資setw(15)籍貫endl; void pprintn() if(Getkg()=0) coutsetw(10)bhsetw(10)namesetw(10)ID_numsetw(10)dutysetw(15)salarysetw(15)adrendl; ;void people:addperson(int b,int a,long int t,char *na,char *dizhi,char *zhiwei) kg=0; bh=b; strcpy(name,na); strcpy(adr,dizhi); strcpy(duty,zhiwei); ID_num=a; salary=t;class qiye/ qiye類int top,in; people man1000;public:qiye();void clear()top=-1; int addperson(int n,int m,int k,char *na,char *dizhi,char *zhiwei) people *p=query(n),*q=query(m),*j=query(k); if(p=NULL) top+; mantop.addperson(n,m,k,na,dizhi,zhiwei); return 1; return 0; people *query(int personid) for(int i=0;i=top;i+) if(mani.GetNo()=personid&mani.Getkg()=0) return &mani;in=i; return NULL; people *qu(char na) for(int i=0;i=top;i+) if(strcmp(mani.GetName(),na)=0&mani.Getkg()=0) return &mani;in=i; return NULL; people *qw(char na) for(int i=0;i=top;i+) if(strcmp(mani.GetName(),na)=0&mani.Getkg()=0) return &mani;in=i; return NULL; people *pq(int qxid) for(int i=0;i=top;i+) if(mani.GetID_num()=qxid&mani.Getkg()=0) coutendl; mani.pprintn(); return NULL; people *qp(char zhiwei) coutendlsetw(11)所找員工資料:endlendl; coutsetw(10)編號setw(10)姓名setw(10)身份證號setw(10)職位setw(15)工資setw(15)籍貫endl; for(int i=0;i=top;i+) if(strcmp(mani.Getduty(),zhiwei)=0&mani.Getkg()=0) coutendl; mani.pprintn(); return NULL; void disp() for(int i=0;i=top;i+) if(mani.Getkg()=0) if(i%5=0) coutendl; mani.pprintn(); void disp2() coutendl; manin.pprintn(); void jiemian1() coutendl; cout 歡迎使用人事管理系統(tǒng)endlendl; coutendl; cout 請按1鍵進(jìn)入系統(tǒng)endlendl; /cout T:退出系統(tǒng)endlendl; coutnnnn; void jiemian3() coutendlendl; cout 輸入任意鍵退出; do exit(0); while(1); void peopledata(); qiye() fstream file(people.dat,ios:out); for(int i=0;i=top;i+) if(mani.Getkg()=0) file.write(char *)&mani,sizeof(mani); file.close(); ;qiye:qiye()people s; top=-1; fstream file(people.dat,ios:in);while(1)file.read(char *)&s,sizeof(s);if(!file)break;top+; mantop=s; file.close();void qiye:peopledata()char choice=0; char ch,peoplen20,addr40,dutyt30; int worherbh; int m; int k; people *w;while(choice!=6)coutendlendl; cout 菜單 endl; coutendl; cout 1:新增endl; cout 2:顯示endl; cout 3:查找endl; cout 4:修改endl; cout 5:刪除endl; cout 6:退出endl; coutendlchoice;if(choice=6) /clear();break; switch(choice)case 1: char ch1;sy
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026福建三明大田縣總醫(yī)院選聘城區(qū)分院工作人員的8人備考題庫(含答案詳解)
- 2026湖北事業(yè)單位聯(lián)考荊門市鐘祥市招聘141人備考題庫附參考答案詳解(培優(yōu))
- 2026年復(fù)合材料設(shè)計(jì)與仿真項(xiàng)目公司成立分析報(bào)告
- 2026湖南湘潭市湘潭縣選調(diào)事業(yè)單位人員13人備考題庫及答案詳解參考
- 2026重慶市涪陵區(qū)龍?zhí)舵?zhèn)人民政府選聘公益性崗位1人備考題庫及一套完整答案詳解
- 2026福建漳州招商局經(jīng)濟(jì)技術(shù)開發(fā)區(qū)海濱學(xué)校招聘2人備考題庫完整答案詳解
- 高中信息技術(shù)(必選6)X6-01-PJ第一章總結(jié)評價(jià)知識點(diǎn)
- 2026年游戲賬號指紋登錄協(xié)議
- 編程教育評估合同2025年評估版
- 《JBT 7152-2020輪胎式裝載機(jī) 全液壓式動力轉(zhuǎn)向器》專題研究報(bào)告
- 2026年及未來5年市場數(shù)據(jù)中國帶電作業(yè)機(jī)器人行業(yè)市場需求預(yù)測及投資規(guī)劃建議報(bào)告
- 錳及化合物職業(yè)健康安全防護(hù)須知
- 春節(jié)后復(fù)產(chǎn)復(fù)工安全培訓(xùn)
- 森林管護(hù)培訓(xùn)
- 2026年北京市房山區(qū)公安招聘輔警考試試題及答案
- 軍品生產(chǎn)現(xiàn)場保密制度
- DB32-T 5320-2025 疾病預(yù)防控制機(jī)構(gòu)檢驗(yàn)檢測能力建設(shè)規(guī)范
- 46566-2025溫室氣體管理體系管理手冊
- 數(shù)據(jù)保護(hù)及信息安全方案手冊
- 電動重卡的可行性報(bào)告
- 中建物資管理手冊
評論
0/150
提交評論