版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、中國(guó)石油大學(xué)(華東)信息與控制工程學(xué)院程序設(shè)計(jì)實(shí)習(xí)報(bào)告小型公司工資管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)專業(yè)班級(jí):電氣12級(jí)4班學(xué)號(hào):120534xx姓名:xxx起止日期:20指導(dǎo)老師:董超群 2013年7月27日 目錄一、 實(shí)習(xí)內(nèi)容1 1.1、課程設(shè)計(jì)的目的1 1.2、設(shè)計(jì)題目及要求1二、 設(shè)計(jì)思路2三、 程序清單43.1、程序源代碼4四、 運(yùn)行結(jié)果134.1、程序運(yùn)行144.2、備份文本信息15五、 程序使用說(shuō)明16六、 總結(jié)及心得體會(huì)17三、程序清單#include <iostream>#include <string>#include <cstdlib>#includ
2、e <fstream>#include<iomanip>using namespace std;const int A=1,B=2,C=1,D=1;/定義全局常變量int n=0;int m2=0,0;int t2;/以下是5個(gè)類的設(shè)計(jì)class Staff/雇員類(基類) public: void data_cin()/成員函數(shù) cout<<"其姓名:"cin>>name; cout<<"性別(m/w):"cin>>sex; cout<<"年齡:"c
3、in>>age; int turn_num() return num; string turn_name() return name; char turn_sex() return sex; int turn_age() return age; protected: int num; string name; int age; char sex; int pay;class Technician:public Staff/技術(shù)員類(雇員類派生類) public: void data_cin() cout<<"技術(shù)員的編號(hào):"cin>>nu
4、m; Staff:data_cin(); cout<<"工作時(shí)間:"cin>>time; int turn_pay1() return 100*time; protected: int time;class Salesman:public Staff/銷售員類(雇員類派生類) public: Salesman()sales_money=0; void data_cin() cout<<"銷售員的編號(hào):"cin>>num; Staff:data_cin(); cout<<"銷售額:&qu
5、ot;cin>>sales_money; cout<<"所屬銷售經(jīng)理的編號(hào):"cin>>belong; pay=sales_money*0.04; int turn_sales_money() return sales_money; int turn_belong() return belong; int turn_pay2() return sales_money*0.04; protected: int sales_money; int belong;class Manager:public Staff/經(jīng)理類(雇員類派生類) pub
6、lic: void data_cin() cout<<"經(jīng)理的編號(hào):"cin>>num; Staff:data_cin(); pay=8000; int turn_pay3() return 8000; ;class Salesmanager:public Manager/銷售經(jīng)理類(經(jīng)理類派生類) public: int turn_num() return num; void data_cin() cout<<"銷售經(jīng)理的編號(hào):"cin>>num; Staff:data_cin(); ;/以下是對(duì)象或?qū)ο?/p>
7、數(shù)組的定義Technician TA;Manager MB;Salesman SC;Salesmanager SMD;/有關(guān)函數(shù)的聲明和定義void fun1();void qian();void zhong();void hou();void fun1()cout<<"-"<<endl;void qian()cout<<""<<endl;cout<<" 職工號(hào) 姓名 性別 年齡 工資 "<<endl;void zhong()cout<<"&
8、quot;<<endl;void hou()cout<<""<<endl;double wageD;/工資計(jì)算方法double SM_wage(Salesman S,Salesmanager SM)int i,j,k;double p;Salesmanager q;for(k=0;k<D;k+) wagek=0; for(i=0;i<D;i+)double sum=0; for(j=0;j<C;j+) if(SMi.turn_num()=Sj.turn_belong()sum+=Sj.turn_sales_money()
9、; wagei=sum*0.005+5000; for(i=0;i<D-1;i+) for(j=0;j<D-1-i;j+) if(wagej<wagej+1)p=wagej+1;wagej+1=wagej;wagej=p; q=SMj+1;SMj+1=SMj;SMj=q; return 0;/以下是主函數(shù)int main()int flag=1,operate;docout<<" 小型公司工資管理系統(tǒng)n"cout<<" n"cout<<" 請(qǐng)選擇您所需的操作 n"cout<&
10、lt;" 數(shù)據(jù)輸入:1,并按回車鍵 n"cout<<" 數(shù)據(jù)統(tǒng)計(jì):2,并按回車鍵 n"cout<<" 數(shù)據(jù)打?。?,并按回車鍵 n"cout<<" 數(shù)據(jù)備份:4,并按回車鍵 n"cout<<" 退出系統(tǒng):5,并按回車鍵 n"cout<<" n"cout<<" 請(qǐng)選擇一個(gè)操作: "cin>>operate;switch(operate)case 1:/在此添加代碼,完成數(shù)據(jù)輸
11、入功能cout<<"請(qǐng)輸入數(shù)據(jù):"<<endl;cout<<"正在輸入數(shù)據(jù)."<<endl;fun1(); int i; for(i=0;i<A;i+)Ti.data_cin();cout<<endl; fun1(); for(i=0;i<B;i+)Mi.data_cin();cout<<endl; fun1(); for(i=0;i<C;i+)Si.data_cin();cout<<endl; fun1(); for(i=0;i<D;i+)SMi
12、.data_cin();cout<<endl; fun1();break;case 2:/在此添加代碼,完成數(shù)據(jù)統(tǒng)計(jì)功能cout<<"請(qǐng)等待."<<endl;cout<<"正在進(jìn)行數(shù)據(jù)統(tǒng)計(jì)."<<endl;int i,j; for(i=0;i<D;i+)cout<<"職工號(hào)為"<<SMi.turn_num()<<"銷售經(jīng)理"<<SMi.turn_name()<<"下屬銷售員的業(yè)績(jī)?yōu)?/p>
13、:"<<endl; cout<<""<<endl; cout<<" 職工號(hào) 姓名 銷售額 "<<endl; for(j=0;j<C;j+) if(Sj.turn_belong()=SMi.turn_num()cout<<""<<endl; cout<<""<<setw(12)<<Sj.turn_num()<<""<<setw(12)<
14、;<Sj.turn_name()<<""<<setw(12)<<Sj.turn_sales_money()<<""<<endl; mi+=Sj.turn_sales_money(); cout<<""<<endl; cout<<"銷售額總計(jì) "<<setw(20)<<mi<<" "<<endl; cout<<""&l
15、t;<endl; cout<<"銷售經(jīng)理排序?yàn)椋?quot;<<endl; qian(); SM_wage(S,SM); for(i=0;i<D;i+)zhong(); cout<<""<<setw(6)<<SMi.turn_num()<<" "<<setw(6)<<SMi.turn_name()<<" "<<setw(6)<<SMi.turn_sex()<<"
16、 "<<setw(6)<<SMi.turn_age()<<" "<<setw(6)<<wagei<<" "<<endl; hou();break;case 3:/在此添加代碼,完成數(shù)據(jù)打印功能cout<<"請(qǐng)等待."<<endl;cout<<"正在進(jìn)行數(shù)據(jù)打印."<<endl;SM_wage(S,SM);int i; cout<<"請(qǐng)稍等"&l
17、t;<endl; cout<<"職工基本情況一覽表如下:"<<endl; cout<<"技術(shù)員"<<endl; qian(); for(i=0;i<A;i+)zhong(); cout<<""<<setw(6)<<Ti.turn_num()<<" "<<setw(6)<<Ti.turn_name()<<" "<<setw(6)<<
18、Ti.turn_sex()<<" "<<setw(6)<<Ti.turn_age()<<" "<<setw(6)<<Ti.turn_pay1()<<" "<<endl;hou();fun1();cout<<"經(jīng)理"<<endl;qian();for(i=0;i<B;i+)zhong();cout<<""<<setw(6)<<Mi.tur
19、n_num()<<" "<<setw(6)<<Mi.turn_name()<<" "<<setw(6)<<Mi.turn_sex()<<" "<<setw(6)<<Mi.turn_age()<<" "<<setw(6)<<Mi.turn_pay3()<<" "<<endl;hou();fun1();cout<<&quo
20、t;銷售經(jīng)理"<<endl;qian();for(i=0;i<D;i+)zhong();cout<<""<<setw(6)<<SMi.turn_num()<<" "<<setw(6)<<SMi.turn_name()<<" "<<setw(6)<<SMi.turn_sex()<<" "<<setw(6)<<SMi.turn_age()<&l
21、t;" "<<setw(6)<<wagei<<" "<<endl;hou();fun1();cout<<"銷售員"<<endl;cout<<""<<endl;cout<<" 職工號(hào) 姓名 性別 年齡 工資 所屬部門經(jīng)理編號(hào)"<<endl;for(i=0;i<C;i+)cout<<""<<endl; cout<<&qu
22、ot;"<<setw(6)<<Si.turn_num()<<" "<<setw(6)<<Si.turn_name()<<" "<<setw(6)<<Si.turn_sex()<<" "<<setw(6)<<Si.turn_age()<<" "<<setw(6)<<Si.turn_pay2()<<" "<
23、<setw(10)<<Si.turn_belong()<<" "<<endl;cout<<""<<endl;fun1();break;case 4:/在此添加代碼,完成數(shù)據(jù)備份功能cout<<"請(qǐng)等待."<<endl;cout<<"正在進(jìn)行數(shù)據(jù)備份."<<endl; SM_wage(S,SM); int i;ofstream outfile;outfile.open("工資管理系統(tǒng).txt&q
24、uot;,ios:out); outfile<<"職工基本情況一覽表如下:"<<'n'<<endl; outfile<<"技術(shù)員"<<endl;outfile<<""<<endl;outfile<<" 職工號(hào) 姓名 性別 年齡 工資 "<<endl;for(i=0;i<A;i+)outfile<<""<<endl;outfile<<
25、""<<setw(6)<<Ti.turn_num()<<" "<<setw(6)<<Ti.turn_name()<<" "<<setw(6)<<Ti.turn_sex()<<" "<<setw(6)<<Ti.turn_age()<<" "<<setw(6)<<Ti.turn_pay1()<<" "&
26、lt;<endl;outfile<<""<<endl;outfile<<"-"<<endl;outfile<<"經(jīng)理"<<endl;outfile<<""<<endl;outfile<<" 職工號(hào) 姓名 性別 年齡 工資 "<<endl;for(i=0;i<B;i+)outfile<<""<<endl;outfile<
27、;<""<<setw(6)<<Mi.turn_num()<<" "<<setw(6)<<Mi.turn_name()<<" "<<setw(6)<<Mi.turn_sex()<<" "<<setw(6)<<Mi.turn_age()<<" "<<setw(6)<<Mi.turn_pay3()<<" &q
28、uot;<<endl; outfile<<""<<endl; outfile<<"-"<<endl; outfile<<"銷售經(jīng)理"<<endl;outfile<<""<<endl;outfile<<" 職工號(hào) 姓名 性別 年齡 工資 "<<endl; for(i=0;i<D;i+)outfile<<""<<endl;outfile<<""<<setw(6)<<SMi.turn_num()<<" "<<setw(6)<<SMi.turn_name()<<" "<<setw(6)<<SMi.turn_sex()<<" "<<setw(6)<<SMi.turn_age()<&
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 廠門口保安接待禮儀規(guī)范
- 尼勒克縣四年級(jí)心理健康測(cè)試模擬題
- 藥物制劑技術(shù)智慧樹知到答案2024年漢中職業(yè)技術(shù)學(xué)院
- 國(guó)家義務(wù)教育質(zhì)量監(jiān)測(cè)(2024年) 中小學(xué)生心理健康測(cè)試試卷
- 13高中數(shù)學(xué)新教材課堂導(dǎo)學(xué)案(雙曲線一)
- 第十一章《三角形》單元測(cè)試卷 2024-2025學(xué)年人教版八年級(jí)數(shù)學(xué)上冊(cè)
- 剎車離合系統(tǒng)用油相關(guān)項(xiàng)目投資計(jì)劃書
- 第1章有理數(shù)單元同步練習(xí)題 2024-2025學(xué)年華東師大版數(shù)學(xué)七年級(jí)上冊(cè)
- 異丙安替比林相關(guān)行業(yè)投資規(guī)劃報(bào)告
- HWREP刷適性改進(jìn)劑相關(guān)行業(yè)投資規(guī)劃報(bào)告
- 輪機(jī)長(zhǎng)用最新輪機(jī)英語(yǔ)4647題庫(kù)
- 普外科試題及答案
- 西師版四年級(jí)上冊(cè)數(shù)學(xué)知識(shí)點(diǎn)整理
- 巖土工程(工程勘察)專業(yè)中級(jí)職稱理論考試題庫(kù)-建設(shè)工程專業(yè)中級(jí)職稱理論考試題庫(kù)
- BZ.JS.SC01.020Rev.00復(fù)方川貝精片工藝規(guī)程1
- 鋼管柱貝雷梁支架計(jì)算
- 公安派出所建筑外觀形象設(shè)計(jì)規(guī)范方案1
- 案例開發(fā)與教學(xué)(課堂PPT)
- 六年級(jí)上冊(cè)《生命_生態(tài)_安全》教學(xué)計(jì)劃
- NT6000系統(tǒng)培訓(xùn)
- 定期清洗消毒空調(diào)及通風(fēng)設(shè)施的制度
評(píng)論
0/150
提交評(píng)論