




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、歡迎共閱 面向?qū)ο髮?shí)訓(xùn)報告 題目:小型公司的工資管理系統(tǒng) 指導(dǎo)老師: xxx 學(xué)生姓名: xxx 班級:計 Yxxx 學(xué)號: xxxxxxxxxxx 時間: xxxx年 x 月 x 日 目錄 一、實(shí)訓(xùn)內(nèi)容與目的 2 二、設(shè)計分析 3 三、執(zhí)行結(jié)果和結(jié)果分析 23 四、實(shí)訓(xùn)總結(jié) 27 一、實(shí)訓(xùn)內(nèi)容 : 小型公司的工資管理 設(shè)計任務(wù) 編寫一個小型公司的工資管理程序。該公司主要有 4 類人員:經(jīng)理、兼職技術(shù)人員、銷售員和 銷售經(jīng)理。其中月薪計算方法為:經(jīng)理固定月薪 8000元,兼職技術(shù)如愿 100 元/小時,銷售員為當(dāng) 月銷售額的 4% ,銷售經(jīng)理保底工資 5000 元另加所管部門銷售額的 5。 設(shè)
2、計要求 (1)職工編號自動產(chǎn)生(從 1000 起編號)。 (2)將公司人員的編號、姓名和月薪等信息保存在文件中,然后從文件中讀入這些信息并顯示。 如果訪問文件失敗,采用異常處理機(jī)制解決。 (3)設(shè)計輸入,輸出的界面。(成績?yōu)閮?yōu)良,需采用 MFC 方式。若設(shè)計困難可以使用 DOS方式) 二、設(shè)計分析 : 歡迎共閱 ( 1) 類的定義: 1、 “ employe.he” #include #include #include #include #include #include classemployee public: employee(); doublegerno(); char*getname
3、(); char*gerpost(); doublegetsalary(); virtual doublepay()=0; employee(doublen,charmingzi20,doubles) number=n; strcpy(name,mingzi); income=s; employee(); protected: doublenumber; charname20; charpost20; doubleincome; ; classTechnician:publicemployee protected: doublehour; doubleper; public: doubleSe
4、t_hour(); doublepay(); ; classSaleman:virtualpublicemployee protected: doublesalary;/銷售額 public: voidsale(); doublepay(); ; 歡迎共閱 classManager:virtualpublicemployee protected: public: doublepay(); ; classSalesmanager:virtualpublicManager,virtualpublicSaleman public: doublepay(); ; structperson intgon
5、ghao; charxingming20; charzhiwei20; floatshouru; floatxiaoshi; ; voidsaverenshu(); intreadrenshu(); voiddeletgon(intx); voiddeletname(intx); voidread(intx); voidxiugai_all(intx); voidsavetech(intx,char*y,char*z,floate,floatho); voidsave(intx,char*y,char*z,floate); (2) ”change.cpp” #includeemployee.h
6、 intk; voidsave(intx,char*y,char*z,floate)/保存文件 structpersona; a.gonghao=x; strcpy(a.xingming,y); strcpy(a.zhiwei,z); a.shouru=e; cout工號:a.gonghao 姓名:a.xingming 職位:a.zhiwei 工資: a.shouruendl; fstreamcun; cun.open(保存人員 .txt,ios:app|ios:out); if(!cun) coutcannotopenfileendl; cuna.gonghaoendl; cuna.zhiw
7、eiendl; 歡迎共閱 cuna.xingmingendl; cuna.shouruendl; cun.close(); voidsavetech(intx,char*y,char*z,floate,floatho) /專用于技術(shù)員的保存 structpersona; a.gonghao=x; strcpy(a.xingming,y); strcpy(a.zhiwei,z); a.shouru=e; a.xiaoshi=ho; cout工號: a.gonghao 姓名: a.xingming 職位: a.zhiwei 工 作小時: a.xiaoshi 工資: a.shouruendl; fs
8、treamcun; cun.open(保存人員 .txt,ios:app|ios:out); if(!cun) coutcannotopenfileendl; cuna.gonghaoendl; cuna.zhiweiendl; cuna.xingmingendl; cuna.xiaoshiendl; cuna.shouruendl; cun.close(); voidsaverenshu()/保存在職總?cè)藬?shù),以便讀取數(shù)據(jù) fstreamcun; cun.open(個數(shù) .txt,ios:trunc|ios:in); if(!cun) coutcannotopenfileendl; cunke
9、ndl; cun.close(); intreadrenshu()/ 讀取在職總?cè)藬?shù) fstreamcun; cun.open(個數(shù) .txt,ios:in|ios:out); if(!cun) coutcannotopenfilek; 歡迎共閱 returnk; voidread(intx)/讀取在職人員信息,參數(shù) x 為總?cè)藬?shù) if(x=0) cout還沒有任何人員的信息,請先添加人員的信息 !endl; structpersona30; fstreamcun; inti=0; cun.open(保存人員 .txt,ios:in|ios:out); if(!cun) coutcannoto
10、penfileendl; while(iai.gonghao; cunai.zhiwei; cunai.xingming; if(strcmp(ai.zhiwei,技術(shù)員 )=0) cunai.xiaoshi; cunai.shouru; if(strcmp(ai.zhiwei,技術(shù)員 )=0) cout 工號: ai.gonghao 姓名: ai.xingming 職位: ai.zhiwei 工作小時 ai.xiaoshi 工資: ai.shouruendl; else cout 工 號 : ai.gonghao 姓 名 : ai.xingming 職 位 : ai.zhiwei 工資: a
11、i.shouruendl; i+; cun.close(); voiddeletgon(intx)/按工號刪除函數(shù),參數(shù) x 為總?cè)藬?shù) if(x=0) cout沒有任何員工的信息,請先增加員工的信息 JK bd=ios:in-ios:ouf); if(oun) 宀 cou7Aoannofopenfi-e二八 cend-; whi-e(icx) 宀 cunvvsdsgonghao; cunvvsdszhiwei; cunvvsdsxingming; if(arcmp(a1szhiwei=JK tllHO) 宀 . ; cunvvsdsxiaoshi; cunvvsHsshouru if(arcm
12、p(a1szhiwei=JK tllHO) 宀 COU7C: H4L tccalsgonghaoccm.ccrmi 二八 calsxingmingccm.cc:sm 二CASH曰 NhiweAA. H、4 ACSHsxs-oshAA=AA H潯-二CCSHsshour-uccmAcend- e_se - 宀 COU7C: H4L tccalsgonghaoccm.ccrmi 二八 calsxingmingccm.cc二sm Acai 曰zhiweAA=AA H 淨(jìng)二八AalnLshourucAtAcend-; H+ cun.coseo = COU7AS鴦 -s-wr刖善 H4n-斥 cendJ
13、T infg; cinvvg; -Ho- whi-e(gH2dsgonghao) 宀 H+ if(gH2dsgonghao) 宀 COU7A萍曲一 tecend- ewe 宀 g 歡迎共閱 for(i=0;i!=g;i+) a2i.gonghao=a1i.gonghao; strcpy(a2i.zhiwei,a1i.zhiwei); strcpy(a2i.xingming,a1i.xingming); if(strcmp(a1i.zhiwei,技術(shù)員 )=0) a2i.xiaoshi=a1i.xiaoshi; a2i.shouru=a1i.shouru; for(i;ix;i+) a2i.go
14、nghao=a1i+1.gonghao; strcpy(a2i.zhiwei,a1i+1.zhiwei); strcpy(a2i.xingming,a1i+1.xingming); if(strcmp(a1i+1.zhiwei,技術(shù)員 )=0) a2i.xiaoshi=a1i+1.xiaoshi; a2i.shouru=a1i+1.shouru; for(intl=0;l(x-1);l+) if(strcmp(a2l.zhiwei,技術(shù)員 )=0) cout工號: a2l.gonghao姓名: a2l.xingming 職位: a2l.zhiwei 工作小時 a2l.xiaoshi 工資: a
15、2l.shouruendl; else cout工號: a2l.gonghao姓名: a2l.xingming 職位: a2l.zhiwei 工資: a2l.shouruendl; fstreamcun1; i=0; cun1.open(保存人員 .txt,ios:trunc); if(!cun1) coutcannotopenfileendl; while(i(x-1) cun1a2i.gonghaoendl; cun1a2i.zhiweiendl; cun1a2i.xingmingendl; 歡迎共閱 if(strcmp(a2i.zhiwei,技術(shù)員 )=0) cun1a2i.xiaosh
16、iendl; cun1a2i.shouruendl; i+; cun1.close(); fstreamcun2; cun2.open(個數(shù).txt,ios:trunc|ios:in); if(!cun2) coutcannotopenfileendl; cun2(x-1)endl; cout成功刪除一個員工的數(shù)據(jù) endl; cun2.close(); voiddeletname(intx)/ 按姓名刪除函數(shù),參數(shù) x 為總?cè)藬?shù) if(x=0) cout沒有任何員工的信息,請先增加員工的信息 endl; structpersona130; structpersona230; fstreamc
17、un; inti=0; cun.open(保存人員 .txt,ios:in|ios:out); if(!cun) coutcannotopenfileendl; while(ia1i.gonghao; cuna1i.zhiwei; cuna1i.xingming; if(strcmp(a1i.zhiwei,技術(shù)員 )=0) cuna1i.xiaoshi; cuna1i.shouru; if(strcmp(a1i.zhiwei,技術(shù)員 )=0) cout工號: a1i.gonghao 姓 名: a1i.xingming崖那 charxin201; cinvvxing; infg; -Ho- wh
18、i-e(arcmp(xingQ)1 曰.xingming) -1 r. h - 1 j-. 宀 H+ g for(帀 o_.HgT+) a2sgonghaoH2Hsgonghap arcpy(a2szhiweLSHszhiwei= arcpy(a2sxingmingSHsxingming); if(arcmp(a1szhiwei=JK tllHO) 宀 a2sxiaoshiH2Hsxiaoshi; a2sshouruH2Hsshouru for(i_.cx_.+) 宀 a2sgonghaoH2HTlLgonghao; arcpy (a2szh i weimlTll zh i wei); arc
19、py(a2 曰.xingmingbln-MLXingming) if(arcmp(a1T二zhiwei=JK tllHO) 宀 a2曰.xiaoshiHal Ei-MLXs-oshi; a2sshouruua1T:shouru; for(infll0;A(x1 );-+) 宀 if(arcmp(a2szhiwei=JK tllHO) 歡迎共閱 cout 工 號 : a2l.gonghao 姓 名 : a2l.xingming 職 位 : a2l.zhiwei 工作小時 a2l.xiaoshi 工資: a2l.shouruendl; else cout工號: a2l.gonghao 姓 名: a
20、2l.xingming 職位 : a2l.zhiwei 工資: a2l.shouruendl; fstreamcun1; i=0; cun1.open(保存人員 .txt,ios:trunc); if(!cun1) coutcannotopenfileendl; while(i(x-1) cun1a2i.gonghaoendl; cun1a2i.zhiweiendl; cun1a2i.xingmingendl; if(strcmp(a2i.zhiwei,技術(shù)員 )=0) cun1a2i.xiaoshiendl; cun1a2i.shouruendl; i+; cun1.close(); fst
21、reamcun2; cun2.open(個數(shù) .txt,ios:trunc|ios:in); if(!cun2) coutcannotopenfileendl; cun2(x-1)endl; cout成功刪除一個員工的數(shù)據(jù) JK tllHO) 宀 cunvvsdsxiaoshi; cunvvsHsshouru if(arcmp(a1szhiwei=JK tllHO) 宀 COU7C: H4L tccalsgonghaoccm.ccrmi 二八 calsxingmingccm.cc二sm 二CASH曰 NhiweAA. H、4 ACSHsxs-oshAA=AA H潯-二CCSHsshour-uc
22、cmAcend- -1 r. h - 1 j-. ewe 宀 、丿 COU7C: H4L tccalsgonghaoccm.ccrmi 二八 calsxingmingccm.cc二sm 二八 Aal 曰zhiweAA=AA H潯-二八AalnLshourucAtAcend-; 工+ incpgonghaol; charxingmingl uolNhiweil E20-; foaffhourld .Xiaos hM; COU7AS鴦 w潯沏 HsH4n【 斥 cendJT cinvvg; -Ho- whi-e(gH2dsgonghao) 宀 i+ g for(iuo;iHg;+) 宀 a2sgo
23、nghaoH2Hsgonghap arcpy(a2szhiweLSHszhiwei= arcpy(a2sxingmingSHsxingming); if(arcmp(a1szhiwei=JK tllHO) 宀 a2sxiaoshiH2Hsxiaoshi; a2 曰.shouruHSH 曰shour5= 歡迎共閱 cout請重新輸入工號: gonghao1; a2i.gonghao=gonghao1; cout請重新輸入姓名: xingming1; strcpy(a2i.xingming,xingming1); cout請重新輸入職位: zhiwei1; strcpy(a2i.zhiwei,zh
24、iwei1); if(strcmp(zhiwei1,技術(shù)員 )=0) cout請重新輸入工作小時數(shù): xiaoshi1; a2i.xiaoshi=xiaoshi1; cout請重新輸入月收入: shouru1; a2i.shouru=shouru1; if(strcmp(a2i.zhiwei,技術(shù)員 )=0) cout 工 號 : a2i.gonghao 姓 名 : a2i.xingming 職 位 : a2i.zhiwei 工作小時: a2i.xiaoshi 工資: a2i.shouruendl; else cout工號: a2i.gonghao 姓 名: a2i.xingming 職位 :
25、 a2i.zhiwei 工資: a2i.shouruendl; i=i+1; for(i;ix;i+) a2i.gonghao=a1i.gonghao; strcpy(a2i.zhiwei,a1i.zhiwei); strcpy(a2i.xingming,a1i.xingming); if(strcmp(a2i.zhiwei,技術(shù)員 )=0) a2i.xiaoshi=a1i.xiaoshi; a2i.shouru=a1i.shouru; fstreamcun1; i=0; cun1.open(保存人員 .txt,ios:trunc); if(!cun1) coutcannotopenfilee
26、ndl; 歡迎共閱 while(ix) cun1a2i.gonghaoendl; cun1a2i.xingmingendl; cun1a2i.zhiweiendl; if(strcmp(a2i.zhiwei,技術(shù)員 )=0) cun1a2i.xiaoshiendl; cun1a2i.shouruendl; i+; cun.close(); (3)“ employe.cepp” #includeemployee.h #include #include #include #include #include #include doubleemployee:gerno() cout請輸入工號 numb
27、er; returnnumber; char*employee:getname() cout請輸入姓名 name; returnname; char*employee:gerpost() cout請輸入職位 post; returnpost; / doubleTechnician:pay() income=30*100*hour; returnincome; doubleTechnician:Set_hour() 歡迎共閱 couthour; returnhour; / voidSaleman:sale() /當(dāng)月銷售額 cout請輸入當(dāng)月銷售額 salary; doubleSaleman:p
28、ay() income=salary*0.04; returnincome; / doubleManager:pay() income=8000; returnincome; / doubleSalesmanager:pay() income=5000+salary*0.05; returnincome; (3)” employe.cepp” #includeemployee.h #include #include #include #include #include #include doubleemployee:gerno() cout請輸入工號 number; returnnumber;
29、 char*employee:getname() cout請輸入姓名 name; returnname; 歡迎共閱 char*employee:gerpost() cout請輸入職位 post; returnpost; / doubleTechnician:pay() income=30*100*hour; returnincome; doubleTechnician:Set_hour() couthour; returnhour; / voidSaleman:sale() /當(dāng)月銷售額 cout請輸入當(dāng)月銷售額 salary; doubleSaleman:pay() income=salar
30、y*0.04; returnincome; / doubleManager:pay() income=8000; returnincome; / doubleSalesmanager:pay() income=5000+salary*0.05; returnincome; (4)”gzgl.cpp” #includeemployee.h #include #include #include 歡迎共閱 #include #include #include #include intIntputMenu(); voidreadmenu(); intdeletmenu(); intxiugaimenu
31、(); intShowmenu(); intai; externintk; voidmain() Showmenu(); intShowmenu() intnu; nu=readrenshu(); while(1) coutendl; cout數(shù)據(jù)錄入 cout刪除數(shù)據(jù) cout修改數(shù)據(jù) cout讀入數(shù)據(jù) cout退出系統(tǒng) cout cout小型公司工資管理系統(tǒng) endl; cout endl; cout請選擇您所需要的操作: endl; 1,并按回車鍵 endl; 2,并按回車鍵 endl; 3,并按回車鍵 endl; 4,并按回車鍵 endl; 5,并按回車鍵 endl; endl; co
32、utendlendlendl; coutai; switch(ai) case1: IntputMenu();break; case2:deletmenu();break; case3:xiugaimenu();break; case4:readmenu();break; case5:return0;break; default:cout你的選擇出錯了! 請重新輸入吧! endl; intdeletmenu() 歡迎共閱 while(1) intr; r=readrenshu(); coutendl; cout小型公司工資管理系統(tǒng) endl; cout endl; cout請選擇您所需要的操作
33、: endl; cout按工號刪除 : 1,并按回車鍵 endl; cout按姓名刪除 :2,并按回車鍵 endl; cout返回上一層 : 3,并按回車鍵 endl; cout endl; coutendlendlendl; coutai; switch(ai) case1: deletgon(r);break; case2:deletname(r);break; case3:return0;break; default:cout你的選擇出錯了! 請重新輸入吧! endl; voidreadmenu() intr; r=readrenshu(); read(r); intxiugaimenu
34、() while(1) intr; r=readrenshu(); coutendl; 需要的操作: endl; 1,并按回車鍵 endl; 2,并按回車鍵 endl; 3,并按回車鍵 endl; 4,并按回車鍵 endl; cout小型公司工資管理系統(tǒng) endl; cout endl; cout請選擇您所 cout修改工號 : cout修改姓名 cout修改職位 cout修改全部 cout返回上一層 : 5,并按回車鍵 endl; cout endl; coutendlendlendl; 歡迎共閱 coutai; switch(ai) endl; /case1: deletgon(r);break; /case2:deletname(r);break; case4:xiugai_all(r);break; case5:return0;break; default:cout你的選擇出錯了! 請重新輸入吧! intIntputMenu() cout小型公司工資管理系統(tǒng) endl; cout endl; cout 請選擇您所需要的操作 endl; cout 經(jīng)理數(shù)據(jù)輸入 :1,并按回車鍵 endl; cout 技術(shù)員數(shù)據(jù)輸入 :2,并按回車鍵 endl; cout銷售員數(shù)據(jù)輸入 :3,并按回車鍵 endl; cout 銷售經(jīng)理數(shù)據(jù)輸入
溫馨提示
- 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)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 個人出售房產(chǎn)合同范本
- 加裝空調(diào)工程合同范本
- 購房合同有購房合同范本
- 單位合伙建房合同范例
- 關(guān)于獨(dú)家合同范本
- 醫(yī)藥會議合同范本
- 單位給買車合同范本
- 化工項目整體承建合同范本
- 產(chǎn)品總經(jīng)銷合同范本
- 醫(yī)院加盟合同范本
- 2025年天津三源電力集團(tuán)有限公司招聘筆試參考題庫含答案解析
- 2025年上半年浙江嘉興桐鄉(xiāng)市水務(wù)集團(tuán)限公司招聘10人易考易錯模擬試題(共500題)試卷后附參考答案
- 2025年腹腔穿刺術(shù)課件 (1)2
- 重慶市2024-2025學(xué)年高一上學(xué)期期末聯(lián)考生物試卷(含答案)
- (八省聯(lián)考)2025年高考綜合改革適應(yīng)性演練 物理試卷合集(含答案逐題解析)
- 2025年度智能倉儲管理系統(tǒng)軟件開發(fā)合同6篇
- 緊急疏散逃生方法
- 羊水栓塞護(hù)理應(yīng)急預(yù)案
- 2024年醫(yī)師定期考核臨床類考試題庫及答案(共500題)
- 2024版數(shù)據(jù)中心建設(shè)與運(yùn)維服務(wù)合同協(xié)議書3篇
- 工程進(jìn)度款支付臺賬-1-
評論
0/150
提交評論