小型公司的工資管理系統(tǒng)實訓(xùn)報告_第1頁
小型公司的工資管理系統(tǒng)實訓(xùn)報告_第2頁
小型公司的工資管理系統(tǒng)實訓(xùn)報告_第3頁
小型公司的工資管理系統(tǒng)實訓(xùn)報告_第4頁
小型公司的工資管理系統(tǒng)實訓(xùn)報告_第5頁
已閱讀5頁,還剩18頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、歡迎共閱面向?qū)ο髮嵱?xùn)報告-題目:小型公司的工資管理系統(tǒng)指導(dǎo)老師:xxx學(xué)生姓名:XXX班級:計Yxxx學(xué)號:XXXXXXXXXXX時間:XXXX年X月X日目錄一、 實訓(xùn)內(nèi)容與目的 2二、 設(shè)計分析 3;_11I I三、執(zhí)行結(jié)果和結(jié)果分析 23四、 實訓(xùn)總結(jié)27一、實訓(xùn)內(nèi)容:小型公司的工資管理. 1v-、 I設(shè)計任務(wù)編寫一個小型公司的工資管理程序。該公司主要有4類人員:經(jīng)理、兼職技術(shù)人員、銷售員和銷售經(jīng)理。其中月薪計算方法為:經(jīng)理固定月薪 8000元,兼職技術(shù)如愿100元/小時,銷售員為當(dāng) 月銷售額的4%,銷售經(jīng)理保底工資5000元另加所管部門銷售額的5%。設(shè)計要求(1) 職工編號自動產(chǎn)生(從

2、1000起編號)。(2) 將公司人員的編號、姓名和月薪等信息保存在文件中,然后從文件中讀入這些信息并顯示。 如果訪問文件失敗,采用異常處理機制解決。(3) 設(shè)計輸入,輸出的界面。(成績?yōu)閮?yōu)良,需采用MFC方式。若設(shè)計困難可以使用DOS方式)二、設(shè)計分析:歡迎共閱(1) 類的定義:1、“ employeh”#include #include #include #include #include #include classemployeepublic:employee(); doublegerno(); char*getname(); char*gerpost(); doublegetsalar

3、y(); virtual doublepay()=0; employee(doublen,charmingzi20,doubles) number=n;strcpy(name,mingzi); income=s;Iemployee();protected: doublenumber; charname20; charpost20; doubleincome;classTechnician:publicemployeeprotected: doublehour; doubleper; public: doubleSet_hour(); doublepay();classSaleman:virtu

4、alpublicemployeeprotected:doublesalary;/銷售額 public: voidsale(); doublepay();歡迎共閱classManager:virtualpublicemployeeprotected:public:doublepay();;classSalesmanager:virtualpublicManager,virtualpublicSalemanpublic:doublepay();;structpersonintgonghao;charxingming20;charzhiwei20;floatshouru;floatxiaoshi;v

5、oidsaverenshu();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.hintk;voidsave(intx,char*y,char*z,floate)II 保存文件structpersona;a.gonghao=x;st

6、rcpy(a.xingming,y);strcpy(a.zhiwei,z);a.shouru=e;coutvv工號:a.gonghao姓名:a.xingming職位:a.zhiwei 工資:vva.shouruvvvendl;fstreamcun;cun.open(保存人員.txt,ios:app|ios:out);if(!cu n)coutvvcannotopenfilevvendl;cunvva.gonghaovvendl;cunvva.zhiweivvendl;歡迎共閱cunvva.xingmingvvendl;cunvva.shouruvvendl;cun.close();voidsa

7、vetech(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;coutvv工號:vva.gonghaovvvv姓名:vva.xingmingvvvv職位:vva.zhiweivv工 作小時:vva.xiaoshivvvv工資:vva.shouruvvvvendl;fstreamcun;cun.open(保存人員.txt,ios:app|ios:out);if(!cu n)co

8、utvvcannotopenfilevvendl;cunvva.gonghaovvendl;cunvva.zhiweivvendl;cunvva.xingmingvvendl;cunvva.xiaoshivvendl;cunvva.shouruvvendl;cun.close();voidsaverenshu()保存在職總?cè)藬?shù),以便讀取數(shù)據(jù)fstreamcun;cun.open(個數(shù).txt,ios:trunc|ios:in);if(!cu n)coutvvcannotopenfilevendl;cunvvkvvendl;cun.close();intreadrenshu()/讀取在職總?cè)藬?shù)f

9、streamcun;cun.open(個數(shù).txt,ios:in|ios:out);if(!cu n)coutvvcannotopenfilevvendl;cunk;歡迎共閱returnk;voidread(intx)II讀取在職人員信息,參數(shù)x為總?cè)藬?shù)if(x=0)coutvv還沒有任何人員的信息,請先添加人員的信息!vvendl;structpersona30;fstreamcun;inti=0;cun.open(保存人員.txt,ios:in|ios:out);if(!cu n) coutvvcannotopenfilevvendl;while(ivx)I I_Jcunai.gongha

10、o;cunai.zhiwei;cunai.xingming; if(strcmp(ai.zhiwei,技術(shù)員)=0) cunai.xiaoshi;cunai.shouru;if(strcmp(ai.zhiwei,技術(shù)員)=0)coutvv工號:vai.gonghaovvvv姓名:vJK bd=ios:in-ios:ouf);if(oun)宀 cou7Aoannofopenfi-e二八 cend-;whi-e(icx)宀 cunvvsdsgonghao;cunvvsdszhiwei; cunvvsdsxingming;if(arcmp(a1szhiwei=JK tllHO) 宀 . ;cunvv

11、sdsxiaoshi;cunvvsHsshouru if(arcmp(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二smAcai 曰zhiweAA=AA H 淨(jìng)二八AalnLshourucAtAcend-;H+cun.coseo=COU

12、7AS鴦 -s-wr刖善 H4n-斥 cendJTinfg;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

13、+) a2i.gonghao=a1i+1.gonghao; strcpy(a2i.zhiwei,a1i+1.zhiwei); strcpy(a2i.xingming,a1i+1.xingming); if(strcmp(a1i+1.zhiwei,技術(shù)員)=0)i Ij y a2i.xiaoshi=a1i+1.xiaoshi; a2i.shouru=a1i+1.shouru; for(intl=0;lv(x-1);l+)if(strcmp(a2l.zhiwei,技術(shù)員)=0)coutvv工號:vva2l.gonghaovvvv姓名:va2l.xingmingvvvv職位: vva2l.zhiwe

14、iv崖那 &sma tecend-;charxin201;cinvvxing;infg;-Ho-whi-e(arcmp(xingQ)1 曰.xingming)-1 r. h - 1 j-.宀H+gfor(帀 o_.HgT+)a2sgonghaoH2Hsgonghap arcpy(a2szhiweLSHszhiwei=arcpy(a2sxingmingSHsxingming);if(arcmp(a1szhiwei=JK tllHO) 宀a2sxiaoshiH2Hsxiaoshi;a2sshouruH2Hsshouru for(i_.cx_.+) 宀a2sgonghaoH2HTlLgonghao;

15、arcpy (a2szh i weimlTll zh i wei); arcpy(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)歡迎共閱coutvv工 號:vva2l.gonghaovvvv姓 名:vva2l.xingmingvvvv 職 位: vva2l.zhiweivv工作小時vva2l.xiaoshivvvv工資:

16、vva2l.shouruvvvvendl;elsecoutvv工號:vva2l.gonghaovvvv姓名:vva2l.xingmingvvvv職位: vva2l.zhiweivvvv工資:vva2l.shouruvvvvendl;fstreamcunl;i=0;cun1.open(保存人員.txt,ios:trunc);if(!cun1)coutvvcannotopenfilevvendl;while(iv(x-1)I I_Jcunlvva2i.gonghaovvendl;cunlvva2i.zhiweivvendl;cunlvva2i.xingmingvvendl;if(strcmp(a2

17、i.zhiwei,技術(shù)員)=0)cunlvva2i.xiaoshivvendl;cunlvva2i.shouruvvendl;i+;cun1.close();fstreamcun2;cun2.open(個數(shù).txt,ios:trunc|ios:in);if(!cun2)coutvvcannotopenfilevvendl;cun2vv(x-1)vvendl;coutvv成功刪除一個員工的數(shù)據(jù)vvendl;cun2.close();voidxiugai_all(intx)/修改一條記錄的內(nèi)容,參數(shù) x為總?cè)藬?shù)structpersona130;structpersona230;fstreamcun

18、;inti=0;cun.open(保存人員.txt,ios:in|ios:out);if(!cu n)宀cou7Aoannofopenfi-e二八 cend-;whi-e(icx)宀cunvvsdsgonghao;cunvvsdszhiwei;cunvvsdsxingming;if(arcmp(a1szhiwei=JK tllHO)宀cunvvsdsxiaoshi;cunvvsHsshouruif(arcmp(a1szhiwei=JK tllHO)宀COU7C: H4L tccalsgonghaoccm.ccrmi 二八 calsxingmingccm.cc二sm 二CASH曰 NhiweAA

19、. H、4 ACSHsxs-oshAA=AA H潯-二CCSHsshour-uccmAcend-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)

20、宀i+ g for(iuo;iHg;+) 宀a2sgonghaoH2Hsgonghap arcpy(a2szhiweLSHszhiwei= arcpy(a2sxingmingSHsxingming); if(arcmp(a1szhiwei=JK tllHO) 宀a2sxiaoshiH2Hsxiaoshi;a2 曰.shouruHSH 曰shour5=歡迎共閱coutvv請重新輸入工號:vvendl;cingonghao1;a2i.gonghao=gonghao1;coutvv請重新輸入姓名:vvendl;cinxingming1;strcpy(a2i.xingming,xingming1);c

21、outvv請重新輸入職位:vvendl;cinzhiwei1;strcpy(a2i.zhiwei,zhiwei1);if(strcmp(zhiwei1,技術(shù)員)=0)coutvv請重新輸入工作小時數(shù):vvendl;cinxiaoshi1;a2i.xiaoshi=xiaoshi1;coutvv請重新輸入月收入:vvendl;cinshouru1;a2i.shouru=shouru1;if(strcmp(a2i.zhiwei,技術(shù)員)=0)coutvv工 號:vva2i.gonghaovvvv 姓 名:vva2i.xingmingvvvv 職 位:vva2i.zhiweivv工作小時:vva2i.

22、xiaoshivvvv工資:vva2i.shouruvvvvendl;elsecoutvv工號:vva2i.gonghaovvvv姓名:vva2i.xingmingvvvv職位: vva2i.zhiweivvvv工資:vva2i.shouruvvvvendl;i=i+1;for(i;ivx;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=

23、a1i.shouru;fstreamcunl;i=0;cun1.open(保存人員.txt,ios:trunc);if(!cun1)coutvvcannotopenfilevvendl;歡迎共閱while(ivx) cunlvva2i.gonghaovvendl; cunlvva2i.xingmingvvendl; cunlvva2i.zhiweivvendl; if(strcmp(a2i.zhiwei,技術(shù)員)=0) cunlvva2i.xiaoshivvendl;cunlvva2i.shouruvvendl; i+; cun.close();(3) “ employeepp”#includ

24、eemployee.h #include #include #include #include #include #include doubleemployee:gerno() coutvv請輸入工號vvendl; cinnumber; returnnumber; char*employee:getname() coutvv請輸入姓名vvendl;- Icinname; returnname; char*employee:gerpost() coutvv請輸入職位vvendl; cinpost; returnpost;/ doubleTechnician:pay() income=30*100

25、*hour; returnincome; doubleTechnician:Set_hour()歡迎共閱COUtVV工作時間:;cinhour; returnhour;/ voidSaleman:sale()/ 當(dāng)月銷售額coutvv請輸入當(dāng)月銷售額vvendl; cinsalary; doubleSaleman:pay() income=salary*0.04; returnincome;/ doubleManager:pay() income=8000; returnincome;/ doubleSalesmanager:pay() income=5000+salary*0.05; ret

26、urnincome;(3)” employeepp”#includeemployee.h #includeviostream.h.#includeviomanip.h #includevstring.h #includevstdio.h #includevstdlib.h #includevfstream.h doubleemployee:gerno() coutvv請輸入工號vvendl; cinnumber;returnnumber; char*employee:getname() coutvv請輸入姓名vvendl; cinname;returnname;歡迎共閱char*employe

27、e:gerpost()coutvv請輸入職位vvendl; cinpost;returnpost;/ doubleTechnician:pay() income=30*100*hour; returnincome; doubleTechnician:Set_hour() _ coutvv工作時間:; cinhour; returnhour;/voidSaleman:sale() / 當(dāng)月銷售額 coutvv請輸入當(dāng)月銷售額vvendl; cinsalary;doubleSaleman:pay()income=salary*0.04; returnincome;/ doubleManager:p

28、ay()income=8000; returnincome;/doubleSalesmanager:pay()income=5000+salary*0.05; returnincome; ” gzgl.cpp#includeemployee.h #includevstring.h #includevstdio.h #includevstdlib.h歡迎共閱#includevfstream.h#include#include #includevfstream.h intlntputMenu(); voidreadmenu(); intdeletmenu(); intxiugaimenu(); i

29、ntShowmenu(); intai; externintk; voidmain()Showmenu(); intShowmenu() intnu;nu=readrenshu(); while(1)coutvvendl; coutvv 小型公司工資管理系統(tǒng)vvendl; coutvv |1vvendl;coutvv |數(shù)據(jù)錄入 coutvv |刪除數(shù)據(jù) coutvv |修改數(shù)據(jù) coutvv |讀入數(shù)據(jù) coutvv |退出系統(tǒng) coutvv 1coutvv |請選擇您所需要的操作:| vvendl;1,并按回車鍵丨vvendl;2, 并按回車鍵| vvendl;3, 并按回車鍵| vven

30、dl;4, 并按回車鍵| vvendl;5, 并按回車鍵| vvendl;1vve ndl;coutvvendlvvendlvvendl; coutvv請選擇一個操作:; cinai;switch(ai)easel: lntputMenu();break; case2:deletmenu();break;case3:xiugaimenu();break; case4:readmenu();break;case5:return0;break; default:coutvv你的選擇出錯了! vv請重新輸入吧! vvendl; intdeletmenu()歡迎共閱while(1) intr;r=re

31、adrenshu(); coutvvendl;coutvv 小型公司工資管理系統(tǒng)vvendl;coutvv |1vvendl;coutvv |請選擇您所需要的操作:| vvendl;coutvv |按工號刪除:1,并按回車鍵| vvendl;coutvv |按姓名刪除:2,并按回車鍵| vvendl;coutvv |返回上一層:3,并按回車鍵| vvendl;coutvv 11vve ndl;coutvvendlvvendlvvendl;coutvv請選擇一個操作:;cinai;switch(ai)casel: deletgon(r);break;case2:deletname(r);brea

32、k;case3:return0;break;default:coutvv你的選擇出錯了! vv請重新輸入吧! vvendl; voidreadmenu() intr;r=readrenshu(); read(r); intxiugaimenu()while(1) intr; r=readrenshu(); coutvvendl; coutvv 小型公司工資管理系統(tǒng)vvendl;coutvv |1vvendl;需要的操作: 丨vvendl;1,并按回車鍵丨vvendl;2, 并按回車鍵丨vvendl;3, 并按回車鍵丨vvendl;4, 并按回車鍵丨vvendl;coutvv |請選擇您所 co

33、utvv |修改工號: coutvv |修改姓名 coutvv |修改職位 coutvv |修改全部coutvv |返回上一層:5,并按回車鍵| vvendl;coutvv 11vve ndl;coutvvendlvvendlvvendl;歡迎共閱coutvv請選擇一個操作:;cinai;switch(ai)/easel: deletgon(r);break; case2:deletname(r);break; case4:xiugai_all(r);break; case5:return0;break;vvendl;default:cout你的選擇出錯了!請重新輸入吧! intlntputMenu()coutvv 小型公司工資管理系統(tǒng)vvendl; coutvv |1 vvendl;coutvv |請選擇您所需要的操作| vvendl; coutvv |經(jīng)理數(shù)據(jù)輸入:1,并按回車鍵| vvendl; coutvv |技術(shù)員數(shù)據(jù)輸入:2,并按回車鍵| vvendl; coutvv |銷售員數(shù)據(jù)輸入:3,并按回車鍵| vvendl; coutvv |銷售經(jīng)理數(shù)據(jù)輸入:4,并按回車鍵| vvendl; coutvv |返回上一層:5,并按回車鍵|

溫馨提示

  • 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論