《面向?qū)ο蟪绦蛟O(shè)計》課程設(shè)計企業(yè)人事管理系統(tǒng)_第1頁
《面向?qū)ο蟪绦蛟O(shè)計》課程設(shè)計企業(yè)人事管理系統(tǒng)_第2頁
《面向?qū)ο蟪绦蛟O(shè)計》課程設(shè)計企業(yè)人事管理系統(tǒng)_第3頁
《面向?qū)ο蟪绦蛟O(shè)計》課程設(shè)計企業(yè)人事管理系統(tǒng)_第4頁
《面向?qū)ο蟪绦蛟O(shè)計》課程設(shè)計企業(yè)人事管理系統(tǒng)_第5頁
已閱讀5頁,還剩26頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、河南城建學(xué)院 面向?qū)ο蟪绦蛟O(shè)計課程設(shè)計 設(shè)計說明書 課程名稱: 面向?qū)ο蟪绦蛟O(shè)計課程設(shè)計 設(shè)計題目: 企業(yè)人事管理系統(tǒng) 指導(dǎo)教師: 班 級: 學(xué) 號: 學(xué)生姓名: 同組人員: 計算機科學(xué)與工程系 2011 年 6 月 23 日 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 1 - 目 錄 第第 1 章章 選選 題題.2 1.1 題目背景.2 1.2 系統(tǒng)實現(xiàn)的具體分工.2 1.2.1 選題.2 1.2.2團隊分工.2 1.3 開發(fā)環(huán)境.3 第第 2 章章 設(shè)計內(nèi)容設(shè)計內(nèi)容.3 2.1 實現(xiàn)功能.3 2.2 概要設(shè)計(涉及類的框圖).4 2.3 界面設(shè)計.4 第第 3 章章 系統(tǒng)實現(xiàn)系統(tǒng)實現(xiàn).4

2、 3.1 涉及知識點.4 3.2 系統(tǒng)運行.12 3.3 源程序清單(關(guān)鍵代碼).15 第第 4 章章 測試與實驗結(jié)果測試與實驗結(jié)果.29 第第 5 章章 結(jié)束語結(jié)束語.30 參考文獻參考文獻.30 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 2 - 第 1 章 選 題 1.1 題目背景 隨著科學(xué)技術(shù)的不斷提高,計算機科學(xué)日漸成熟,其強大的功能已為人們深刻認(rèn)識,它 已進入人類社會的各個領(lǐng)域并發(fā)揮著越來越重要的作用。 作為計算機應(yīng)用的一部分,使用計算機對人事信息進行管理,具有著手工管理所無法 比擬的優(yōu)點.例如:檢索迅速、查找方便、可靠性高、存儲量大、保密性好、壽命長、成 本低等。這些優(yōu)點能夠極

3、大地提高人事理的效率,也是企業(yè)的科學(xué)化、正規(guī)化管理,與世 界接軌的重要條件。因此,開發(fā)這樣一套管理軟件成為很有必要的事情。 目前,無論是機關(guān)、事業(yè)單位、還是企業(yè)單位,人事管理對于組織生存與長遠發(fā)展 所具備的重要性都已經(jīng)有了明確的認(rèn)識,而人事管理水平的提升不僅需要高素質(zhì)的管 理人員,而且也需要信息化工具進行輔助 在現(xiàn)代化的企業(yè)管理中,人事管理系統(tǒng)有著十分重要的作用,然而,用大型軟件系 統(tǒng)來于小型的企事業(yè)單位,不啻于“殺雞用牛刀” ,因此小型的的軟件對于這種單位自 然有十分重要作用。 1.2 系統(tǒng)實現(xiàn)的具體分工 1.2.1 選題 此項目是為了適應(yīng)現(xiàn)代化企業(yè)的發(fā)展潮流,從而實現(xiàn)用計算機進行企業(yè)人事管

4、理,達到檢索迅 速、查找方便、可靠性高、存儲量大、保密性好等功能。一下是項目的功能: 1、添加功能: 添加一個職員的基本信息,包括姓名,工作證號,身份證號碼,生日,家庭住址, 家庭電話號碼,部門,薪水,性別,職務(wù)。 2、刪除功能: 能夠?qū)σ粋€職員的信息進行刪除按姓名進行刪除。 3、刪除全部職員信息: 能夠?qū)τ谌柯殕T的信息進行刪除! 4、顯示功能: 顯示所有職員的主要信息包括姓名,身份證號碼,工作證號,生日等。 5、查找功能: 根據(jù)你鍵入的職員姓名,顯示其詳細信息! 6、修改功能: 對職員的信息進行修改。 7、保存信息 對全部信息進行保存。 8、退出程序 能夠退出程序。 1.2.2團隊分工 表

5、 1.1 項目分工一覽表 角色姓名承擔(dān)的具體任務(wù) 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 3 - 組長于嘉構(gòu)架整個程序的模塊,負責(zé)部門類于全體 職工類的構(gòu)造。 組員趙鑫磊已生成文件的方式保存錄入的信息,組織 交互界面,調(diào)試程序以及優(yōu)化程序。 組員千利穩(wěn)編寫增刪改查的模塊程序,構(gòu)造 base 類。 1.3 開發(fā)環(huán)境 編程工具:visual c+ 6.0 機型:方正電腦 處理器名稱:intel(r)core(tm)2 duo cpu e7200 2.53ghz 硬盤驅(qū)動器:wdc wd1600aajs-22waao 系統(tǒng)內(nèi)存:金士頓內(nèi)存 2gb 顯示卡: nvidia geforce 940

6、0 gt 顯示器: 方正科技 fg981-w9 操作系統(tǒng):microsoft windows xp professional 第 2 章 設(shè)計內(nèi)容 2.1 實現(xiàn)功能 1、添加功能: 添加一個職員的基本信息,包括姓名,工作證號,身份證號碼,生日,家庭住址, 家庭電話號碼,部門,薪水,性別,職務(wù)。 2、刪除功能: 能夠?qū)σ粋€職員的信息進行刪除按姓名進行刪除。 3、刪除全部職員信息: 能夠?qū)τ谌柯殕T的信息進行刪除! 4、顯示功能: 顯示所有職員的主要信息包括姓名,身份證號碼,工作證號,生日等。 5、查找功能: 根據(jù)你鍵入的職員姓名,顯示其詳細信息! 6、修改功能: 對職員的信息進行修改。 7、保存

7、信息 對全部信息進行保存。 8、退出程序 能夠退出程序。 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 4 - 2.2 概要設(shè)計(涉及類的框圖) 系統(tǒng) base 類 personnel 類 maintain 類 員 工 工 作 號 員 工 姓 名 員 工 身 份 證 號 員 工 性 別 員 工 生 日 員 工 家 庭 住 址 員 工 電 話 員 工 職 務(wù) 員 工 薪 水 員 工 職 務(wù) 員 工 薪 水 員 工 工 作 號 員 工 姓 名 員 工 身 份 證 號 員 工 性 別 員 工 生 日 員 工 家 庭 住 址 員 工 電 話 2.3 界面設(shè)計 界面設(shè)計在工作流程上分為結(jié)構(gòu)設(shè)計、交互設(shè)計

8、、視覺設(shè)計三個部分。 結(jié)構(gòu)設(shè)計也稱概念設(shè)計 (conceptual design) ,是界面設(shè)計的骨架。該企業(yè)人事 管理系統(tǒng)運行時界面上的目錄體系和詞語定義易于用戶理解和操作,例如主界面的目 錄體系包括 1 錄入員工信息、2 顯示員工信息、3、查找員工信息 4、刪除員工信息、5 、修改員工信息、6、清空員工信息、7、保存員工信息、8、退出。其中錄入信息會出 現(xiàn) 1、人事部、2、維修部、3、銷售部。 第 3 章 系統(tǒng)實現(xiàn) 3.1 涉及知識點 類的設(shè)計與分析 為了界面簡潔些,用了幾個類。一個類包含員工的基本信息,一個類包含部門的信 息,一個類繼承了基本信息和部門信息。 1base 類 class

9、base public: int no; int id; string name; string sex; int birthday; string address; int phone; void input() cout輸入員工的工作號:no; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 5 - cout輸入員工的姓名:name; cout輸入員工的性別:sex; cout輸入員工的身分證:id; cout輸入員工的生日:birthday; cout輸入員工的家庭住址:address; cout輸入員工的家庭電話號碼:phone; void output() coutsetiosflag

10、s(ios:left)setw(8)no setw(8)namesetw(6)sexsetw(8)idsetw(10)birthday setw(8)addresssetw(10)phone; ; base 類說明表 名稱屬性說明 no數(shù)據(jù)成員記錄員工對象的工作號 name數(shù)據(jù)成員記錄員工對象的姓名 id 數(shù)據(jù)成員記錄員工對象的身分證 sex 數(shù)據(jù)成員記錄員工對象的性別 birthday 數(shù)據(jù)成員記錄員工對象的生日 address 數(shù)據(jù)成員記錄員工對象的家庭住址 phone 數(shù)據(jù)成員記錄員工對象的電話 void input()成員方法成員函數(shù),輸入數(shù)據(jù) void output()成員方法成員函

11、數(shù),輸出數(shù)據(jù) 2personnel 類 class personnel /人事部 public: virtual void show() cout人事部endl; string job; int pay; void input() cout請輸入該員工的職務(wù)job; cout請輸入該員工的薪水pay; void output() coutsetiosflags(ios:left)職務(wù):setw(6)job 薪水:setw(6)payendl; ; personnel類說明表 名稱屬性說明 job 數(shù)據(jù)成員記錄員工對象的職務(wù) pay 數(shù)據(jù)成員記錄員工對象的薪水 virtual void show

12、() 成員方法虛函數(shù),顯示所在的部門 void input() 成員方法成員函數(shù),輸入數(shù)據(jù) void output() 成員方法成員函數(shù),輸出數(shù)據(jù) 3繼承類 class maintain:public personnel /維修部 public: virtual void show() cout維修部endl; ; maintain 類說明表 名稱屬性說明 job 數(shù)據(jù)成員記錄員工對象的職務(wù) pay 數(shù)據(jù)成員記錄員工對象的薪水 virtual void show() 成員方法虛函數(shù),顯示所在的部門 void input() 成員方法成員函數(shù),輸入數(shù)據(jù) void output() 成員方法成員函

13、數(shù),輸出數(shù)據(jù) class staff : public base, public branch ; staff 類說明表 名稱屬性說明 no數(shù)據(jù)成員記錄員工對象的工作號 name數(shù)據(jù)成員記錄員工對象的姓名 id 數(shù)據(jù)成員記錄員工對象的身分證 sex 數(shù)據(jù)成員記錄員工對象的性別 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 7 - birthday 數(shù)據(jù)成員記錄員工對象的生日 address 數(shù)據(jù)成員記錄員工對象的家庭住址 phone 數(shù)據(jù)成員記錄員工對象的電話 void input()成員方法成員函數(shù),輸入數(shù)據(jù) void output()成員方法成員函數(shù),輸出數(shù)據(jù) job 數(shù)據(jù)成員記錄員工對象

14、的職務(wù) pay 數(shù)據(jù)成員記錄員工對象的薪水 virtual void show() 成員方法虛函數(shù),顯示所在的部門 void input() 成員方法成員函數(shù),輸入數(shù)據(jù) void output() 成員方法成員函數(shù),輸出數(shù)據(jù) 模塊設(shè)計與分析 1錄入員工信息錄入員工信息 void insert()/錄入數(shù)據(jù) int n; while(1) cout請輸入部門的代碼: 1-人事部 2-維修部 3銷售部n; if(n=1|n=2|n=3) if(n=1) do staff *p; p=new staff; p-bumen.show(); p-input(); p-bumen.input(); int

15、 q; do for(int i=0;ino=p-no) cout此工作號已存在!請修改!input(); p-bumen.input(); q+; break; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 8 - while(q!=0); for(int j=0;jn;j+) if(pj=null) pj=p; cout輸入成功!endl; break; coutn; while(n=1); p 申請新的 staff空間,輸入數(shù)據(jù),檢查所輸入的信息是否已經(jīng)存在, 存在顯示數(shù)據(jù)已經(jīng)存在,重新輸入新的數(shù)據(jù),再檢查,直到輸入沒有錯誤。進入保 存該正確的數(shù)據(jù),空間要有足夠的空間才能保存數(shù)據(jù),不足就

16、保存失敗。 2顯示員工信息顯示員工信息 void show()/顯示數(shù)據(jù) staff *p; coutoutendl; for(int j=0;joutput(); p-bumen.output(); 只要 p 的空間內(nèi)不為空就輸出數(shù)據(jù)。 3查找員工信息查找員工信息 void find()/查找數(shù)據(jù) string n; cout輸入你要查找姓名n; for(int j=0;jname)=n) pj-bumen.show(); coutoutoutput();pj-bumen.output(); break; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 9 - 輸入要查找的名字,循環(huán)空間,空間

17、不為空,而且空間里的名字與輸入的名字 對比, 符合就輸出該數(shù)據(jù),不符合下一條數(shù)據(jù),直到符合為止。如果全部空間掃描完都沒 有找到該信息,就輸出不存在該信息。 4刪除員工信息刪除員工信息 void delete()/刪除數(shù)據(jù) string n;int m; cout輸入你要查找姓名n; cout請輸入該員工所在的部門的代碼: 1-人事部 2-維修部 3銷售部m; if(m=1) for(int j=0;jname)=n) coutoutoutput();pj-bumen.output(); pj=null; cout該員工已被刪除!endl; break; 輸入要查找的名字,循環(huán)空間,空間不為空,

18、而且空間里的名字與輸入的名 字對比,符合就把該項的數(shù)據(jù)賦為空值,不符合下一條數(shù)據(jù),直到符合為止。如 果全部空間掃描完都沒有找到該信息,沒有信息輸出。 5修改員工信息修改員工信息 void revise()/修改數(shù)據(jù) string n;int m; cout輸入你要查找姓名n; cout請輸入該員工所在的部門的代碼: 1-人事部 2-維修部 3銷售部m; if(m=1) for(int j=0;jname)=n) coutoutoutput();pj-bumen.output(); 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 10 - pj-input();pj-bumen.input();

19、cout該員工修改成功!; break; 輸入要查找的名字,循環(huán)空間,空間不為空,而且空間里的名字與輸入的名 字對比,符合就重新輸入數(shù)據(jù),不符合下一條數(shù)據(jù),直到符合為止。如果全部空 間掃描完都沒有找到該信息,就沒有信息輸出。 6清空員工信息清空員工信息 void clear()/清空數(shù)據(jù) int n,a=1; do cout請輸入密碼 0返回界面n; if(n=a) for(int i=0;in;i+) pi=null; mi=null; si=null; cout所有員工的資料已被刪除!endl;break; else cout輸入密碼失敗!endl; while(n!=0); 首先清空全部

20、員工數(shù)據(jù)是要慎重考慮的,所以要設(shè)置密碼,且密碼定義為 1,沒有密 碼不能清空全部員工。密碼正確,然后把所有的空間都賦為空值。 7保存員工信息保存員工信息 void save()/保存數(shù)據(jù) ofstream output_file; ofstream output_file1; ofstream output_file2; ofstream output_file3; cout正在保存中.endl; output_file.open(personnel.txt); if(!output_file) cout保存 personnel 文件失敗!endl; for(int i=0;in;i+) if

21、(pi!=null) 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 11 - output_fileno sex name id birthday address phone bumen.job bumen.payendl; b1+; output_file2.open(maintain.txt); if(!output_file2) cout保存 maintain 文件失敗!endl; for( i=0;in;i+) if(mi!=null) output_file2no sex name id birthday address phone bumen.job bumen.payendl;

22、b2+; output_file3.open(sell.txt); if(!output_file3) cout保存 sell 文件失敗!endl; for( i=0;in;i+) if(si!=null) output_file3no sex name id birthday address phone bumen.job bumen.payendl; b3+; 因為我用了 3 個數(shù)組來保存 3 個不同的部門信息,所以就用了 3 個不同的文件 來保存。然后再用一個文件來保存各個部門的數(shù)據(jù)的條數(shù),這樣是用來控制讀出 文件的條數(shù),防止讀出錯誤的信息。 8退出程序退出程序 面向?qū)ο蟪绦蛟O(shè)計 c+

23、課程設(shè)計實驗報告 - 12 - 3.2 系統(tǒng)運行 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 13 - 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 14 - 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 15 - 圖 3.1 系統(tǒng)主界面 3.3 源程序清單(關(guān)鍵代碼) /basic.h #includestring #includeiostream #include iomanip using namespace std; class base public: int no; int id; string name; string sex; int birthday; string add

24、ress; int phone; void input() cout輸入員工的工作號:no; cout輸入員工的姓名:name; cout輸入員工的性別:sex; cout輸入員工的身分證:id; cout輸入員工的生日:birthday; cout輸入員工的家庭住址:address; cout輸入員工的家庭電話號碼:phone; void output() coutsetiosflags(ios:left)setw(8)no setw(8)namesetw(6)sexsetw(8)idsetw(10)birthday setw(8)addresssetw(10)phone; ; /branc

25、h.h #includeiostream #includestring #include iomanip using namespace std; class personnel /人事部 public: virtual void show() cout人事部endl; string job; int pay; void input() cout請輸入該員工的職務(wù)job; cout請輸入該員工的薪水pay; void output() coutsetiosflags(ios:left)職務(wù):setw(6)job 薪水:setw(6)payendl; ; class maintain:publi

26、c personnel /維修部 public: virtual void show() 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 17 - cout維修部endl; ; class sell:public personnel /銷售部 public: virtual void show() cout銷售部endl; ; template class branch public: type bumen; ; /staff.h #includebasic.h #includebranch.h #includeiostream using namespace std; template cla

27、ss staff : public base, public branch ; /頭文件 #includestring #include #includestaff.h #includecstdio #includeconio.h #includefstream #includeiostream #includestdlib.h #define n 100 using namespace std; staff *pn; staff *mn; staff *sn; const int size_char = 5; const char cch = abcdefghijklmnopqrstuvwx

28、yzabcdefghijklmnopqrstuvwxyz; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 18 - int b1=0,b2=0,b3=0;/導(dǎo)入數(shù)據(jù)條數(shù) string m()/隨機生字母 char chsize_char + 1 = 0; for (int i = 0; i size_char; +i) int x = rand() % (sizeof(cch) - 1); chi = cchx; return ch; ostream void insert()/錄入數(shù)據(jù) int n; while(1) cout請輸入部門的代碼: 1-人事部 2-維修部 3銷售部n; if(n

29、=1|n=2|n=3) if(n=1) do staff *p; p=new staff; p-bumen.show(); p-input(); p-bumen.input(); int q; do for(int i=0;ino=p-no) cout此工作號已存在!請修改!input(); p-bumen.input(); q+; break; while(q!=0); for(int j=0;jn;j+) if(pj=null) pj=p; cout輸入成功!endl; break; coutn; while(n=1); else if(n=2) do staff *a; a=new st

30、aff; a-bumen.show(); a-input(); a-bumen.input(); int q; do for(int i=0;ino=a-no) cout此工作號已存在!請修改!input(); a-bumen.input(); q+; break; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 20 - while(q!=0); for(int j=0;jn;j+) if(mj=null) mj=a; cout輸入成功!endl; break; coutn; while(n=2); else if(n=3) do staff *s; s=new staff; s-bumen.

31、show(); s-input(); s-bumen.input(); int q; do for(int i=0;ino=s-no) cout此工作號已存在!請修改!input(); s-bumen.input(); q+; break; while(q!=0); for(int j=0;jn;j+) if(sj=null) sj=s; cout輸入成功!endl; break; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 21 - coutn; while(n=3); break; void show()/顯示數(shù)據(jù) int n; while(1) cout請輸入部門的代碼: 1-人事部

32、2-維修部 3銷售部 n; if(n=1|n=2|n=3) if(n=1) staff *p; coutoutendl; for(int j=0;joutput(); p-bumen.output(); break; else if(n=2) staff *a; coutoutendl; for(int i=0;ioutput(); a-bumen.output(); 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 22 - break; else if(n=3) staff *s; coutoutendl; for(int i=0;ioutput(); s-bumen.output(); br

33、eak; else if(n=0) break; void find()/查找數(shù)據(jù) string n; cout輸入你要查找姓名n; for(int j=0;jname)=n) pj-bumen.show(); coutoutoutput();pj-bumen.output(); break; for(j=0;jname)=n) mj-bumen.show(); coutoutoutput();mj-bumen.output(); 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 23 - break; for(j=0;jname)=n) sj-bumen.show(); coutoutoutpu

34、t();sj-bumen.output(); break; void delete()/刪除數(shù)據(jù) string n;int m; cout輸入你要查找姓名n; cout請輸入該員工所在的部門的代碼: 1-人事部 2-維修部 3銷售部 m; if(m=1) for(int j=0;jname)=n) coutoutoutput();pj-bumen.output(); pj=null; cout該員工已被刪除!endl; break; if(m=2) for(int j=0;jname)=n) coutoutoutput();mj-bumen.output(); mj=null; cout該員工

35、已被刪除!endl; break; if(m=3) for(int j=0;jname)=n) coutoutoutput();sj-bumen.output(); sj=null; cout該員工已被刪除!endl; break; void revise()/修改數(shù)據(jù) string n;int m; cout輸入你要查找姓名n; cout請輸入該員工所在的部門的代碼: 1-人事部 2-維修部 3銷售部 m; if(m=1) for(int j=0;jname)=n) coutoutoutput();pj-bumen.output(); pj-input();pj-bumen.input();

36、 cout該員工修改成功!; break; if(m=2) 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 25 - for(int j=0;jname)=n) coutoutoutput();mj-bumen.output(); mj-input();mj-bumen.input(); cout該員工修改成功!; break; if(m=3) for(int j=0;jname)=n) coutoutoutput();sj-bumen.output(); sj-input();sj-bumen.input(); cout該員工修改成功!; break; void clear()/清空數(shù)據(jù) in

37、t n,a=1; do cout請輸入密碼 0返回界面n; if(n=a) for(int i=0;in;i+) pi=null; mi=null; si=null; cout所有員工的資料已被刪除!endl;break; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 26 - else cout輸入密碼失敗!endl; while(n!=0); void save()/保存數(shù)據(jù) ofstream output_file; ofstream output_file1; ofstream output_file2; ofstream output_file3; cout正在保存中.endl; o

38、utput_file.open(personnel.txt); if(!output_file) cout保存 personnel 文件失敗!endl; for(int i=0;in;i+) if(pi!=null) output_fileno sex name id birthday address phone bumen.job bumen.payendl; b1+; output_file2.open(maintain.txt); if(!output_file2) cout保存 maintain 文件失敗!endl; for( i=0;in;i+) if(mi!=null) outpu

39、t_file2no sex name id birthday address phone bumen.job bumen.payendl; b2+; output_file3.open(sell.txt); if(!output_file3) cout保存 sell 文件失敗!endl; for( i=0;in;i+) if(si!=null) output_file3no sex name id birthday address phone bumen.job bumen.payendl; b3+; output_file1.open(kongzhi.txt); output_file1b1

40、 b2 b3endl;/保存數(shù)據(jù)條數(shù) output_file1.close(); output_file.close(); output_file2.close(); output_file3.close(); cout保存完畢!b1b2b3; input_file.open(personnel.txt); input_file2.open(maintain.txt); input_file3.open(sell.txt); if(!input_file|!input_file2|!input_file3) cout打開文件失敗!endl; cout建立新的數(shù)據(jù)!endl; for(int i

41、=0;in;i+) pi=null; mi=null; si=null; for(i=0;i32;i+) /隨機生成數(shù)據(jù) pi=new staff; pi-no=100+i;pi-sex=m;pi-name=m();pi-id=1000+rand()%100; pi-birthday=1988000+rand()%100;pi-address=m();pi- phone=13567+rand()%100; pi-bumen.job=m();pi-bumen.pay=2000+rand()%101; mi=new staff; mi-no=100+i;mi-sex=m;mi-name=m();m

42、i-id=1000+rand()%100; 面向?qū)ο蟪绦蛟O(shè)計 c+ 課程設(shè)計實驗報告 - 28 - mi-birthday=1988000+rand()%100;mi-address=m();mi- phone=13567+rand()%100; mi-bumen.job=m();mi-bumen.pay=2000+rand()%101; si=new staff; si-no=100+i;si-sex=m;si-name=m();si-id=1000+rand()%100; si-birthday=1988000+rand()%100;si-address=m();si- phone=135

43、67+rand()%100; si-bumen.job=m();si-bumen.pay=2000+rand()%101; else for(int i=0;ib1;i+) pi=new staff; input_filepi-nopi-sexpi-namepi-idpi- birthdaypi-addresspi-phonepi-bumen.jobpi-bumen.pay; for(i=0;ib2;i+) mi=new staff; input_file2mi-nomi-sexmi-namemi-idmi- birthdaymi-addressmi-phonemi-bumen.jobmi-b

44、umen.pay; for(i=0;ib3;i+) si=new staff; input_file3si-nosi-sexsi-namesi-idsi- birthdaysi-addresssi-phonesi-bumen.jobsi-bumen.pay; cout錄入成功!endl; input_file.close(); input_file1.close(); input_file2.close(); input_file3.close(); char n; while(1) while(1) system(color 006); b1=0,b2=0,b3=0;/清空原先的數(shù)據(jù)條數(shù) cout 人事管理管理系統(tǒng) endl; cout* * * * * * * * * * * * * * * * * * * * * * * * * * * *end

溫馨提示

  • 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論