C++小型企业工资管理系统.docx

上传人:b****3 文档编号:10484156 上传时间:2023-05-26 格式:DOCX 页数:22 大小:87.25KB
下载 相关 举报
C++小型企业工资管理系统.docx_第1页
第1页 / 共22页
C++小型企业工资管理系统.docx_第2页
第2页 / 共22页
C++小型企业工资管理系统.docx_第3页
第3页 / 共22页
C++小型企业工资管理系统.docx_第4页
第4页 / 共22页
C++小型企业工资管理系统.docx_第5页
第5页 / 共22页
C++小型企业工资管理系统.docx_第6页
第6页 / 共22页
C++小型企业工资管理系统.docx_第7页
第7页 / 共22页
C++小型企业工资管理系统.docx_第8页
第8页 / 共22页
C++小型企业工资管理系统.docx_第9页
第9页 / 共22页
C++小型企业工资管理系统.docx_第10页
第10页 / 共22页
C++小型企业工资管理系统.docx_第11页
第11页 / 共22页
C++小型企业工资管理系统.docx_第12页
第12页 / 共22页
C++小型企业工资管理系统.docx_第13页
第13页 / 共22页
C++小型企业工资管理系统.docx_第14页
第14页 / 共22页
C++小型企业工资管理系统.docx_第15页
第15页 / 共22页
C++小型企业工资管理系统.docx_第16页
第16页 / 共22页
C++小型企业工资管理系统.docx_第17页
第17页 / 共22页
C++小型企业工资管理系统.docx_第18页
第18页 / 共22页
C++小型企业工资管理系统.docx_第19页
第19页 / 共22页
C++小型企业工资管理系统.docx_第20页
第20页 / 共22页
亲,该文档总共22页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

C++小型企业工资管理系统.docx

《C++小型企业工资管理系统.docx》由会员分享,可在线阅读,更多相关《C++小型企业工资管理系统.docx(22页珍藏版)》请在冰点文库上搜索。

C++小型企业工资管理系统.docx

C++小型企业工资管理系统

存档资料成绩:

  

华东交通大学

课程设计报告书

 

所属课程名称C++程序设计  

题目小型企业工资管理系统

院(系) 软 件学院  

班级网络2006-班 

学  号

学生姓名

指导教师     

辅导教师  

2007年7月7日

华东交通大学

课程设计(论文)任务书

软件学院专业网络工程班级06级2班

一、课程设计(论文)题目小型企业工资管理系统

二、课程设计(论文)工作:

自2007年6月25日起至2007年7月6日止。

三、课程设计(论文)的内容要求:

1)数据录入:

输入各种数据.

2)数据统计:

各销售经理的工资计算及最终按工资进行的冒泡排序.

3)数据打印:

打印各种数据.

4)数据备份:

把相关的数据写入文件.

5)退出:

退出本系统.

学生签名:

2007年7月9日

课程设计(论文)评阅意见

项目

等   级

优秀

良好

中等

及格

不及格

课程设计态度评价

出勤情况评价

任务难度评价

工作量饱满评价

设计中创新性评价

论文书写规范化评价

综合应用能力评价

综合评定等级

优秀( )良好( )中等( )及格( )不及格( )

评阅人 谢昕职称副教授

2007年7月11日

目 录

一、需求分析

1.从要求上来看是要对各个员工的各种情况(名字、年龄、性别、职位、工资状况)进行输入。

然后可以输出.

2.可以对于员工数据进行修改,可以查询.

3.对于员工的各种情况系统还可以进行统计排名.

二、概要设计

首先,创建了一个employee类.然后派生出四个类:

manager、technician、salesman、salesmanager.在派生类中定义了三个构造函数,分别是:

数据输入函数(Input),表格输出函数(Print),排序函数(Pay).

其次,在总体结构上,建立以各根菜单,用于选择各种功能.

1.Input(数据输入):

输入员工的各种数据.

2.Total(数据统计):

将员工的总数据进行对比排序,然后输出.

3.Output(数据显示):

显示输入的各种数据.

4.Save(数据保存):

对输入的数据进行保存备份.

5.Eixt(退出程序):

执行退出程序命令.

三、详细设计

1.Input(数据输入):

定义了各个岗位的人员的类,并把每个类的人员的属性设为类中的保护成员,其中技术工的工作时间和每小时的所得为私有成员,而销售员的销售额、经理的工资和销售经理的所辖部门的销售额和其底薪设为公有成员,再依次录入。

2.Total(数据统计):

根据所有类的工资算法在其所属类中定义一个函数voidpay()来根据各个职位的具体情况来计算工资,并且算出的工资经过冒泡法排序.

voidprinttotal()

{

cout<<"├─────┴──┬──┴─────┤"<

cout<<"│Total │  "<

cout<<"└────────┴────────┘"<

}

3.Output(数据显示):

通过do-while循环以及制表格和setw的使用将输入的数据和统计并排序的数据以表格的形式打印出来,销售额合计一栏宽度要大些。

voidsaleprint()

{

cout<<"│"<

cout<<"├─────┼─────┼─────┤"<

cout<<"│"<

cout<<"├─────┼─────┼─────┤"<

cout<<"│"<

cout<<"├─────┼─────┼─────┤"<

cout<<"│"<

}

voidprint()

{

cout<<"├─────┼─────┼─────┼─────┼─────┤"<

cout<<"│"<

<

}

4.Save(数据保存):

通过函数save()来将输入的数据和统计并排序的数据进行保存.例如:

voidsave()

{

fstreamoutfile;

outfile.open("f:

flsdfj.txt",ios:

:

app);

if(!

outfile)

{

cout<<"fcan'topen.\n";

abort();

}

outfile<<"Salesmanger"<

outfile<<"ID"<

}

5.Eixt(退出):

利用exit来完成退出系统功能。

 

四、设计和调试分析

程序清单:

#include

#include

#include

#include

#include

classemployee

{

public:

employee()

{

salary=0;

}

voidpay(){}

voidprint(){}

voidinput()

{

cout<<"ID:

";

cin>>no;

cout<<"NAME:

";

cin>>name;

cout<<"SEX(m/w):

";

cin>>sex;

cout<<"AGE:

";

cin>>age;

}

protected:

intno;

charname[8];

floatsalary;

charsex;

intage;

};

classmanager:

virtualpublicemployee

{

protected:

floatmonthlypay,sale;

public:

manager(){monthlypay=8000;}

voidinput(){cout<<"Manger";employee:

:

input();}

voidsave()

{

fstreamoutfile;

outfile.open("f:

flsdfj.txt",ios:

:

app);

if(!

outfile)

{

cout<<"fcan'topen.\n";

abort();

}

outfile<<"Manger"<

outfile<<"ID"<

}

voidpay(){salary=monthlypay;}

voidprint()

{

cout<<"├─────┼─────┼─────┼─────┼─────┤"<

cout<<"│"<

<<"│"<

}

};

classtechnician:

virtualpublicemployee

{

private:

floathourlyrate;

intworkhours;

public:

technician(){hourlyrate=100;}

voidpay()

{

cout<

";

cin>>workhours;

salary=hourlyrate*workhours;

}

voidinput(){cout<<"TECHNICIAN"<

:

input();}

voidsave()

{

fstreamoutfile;

outfile.open("f:

flsdfj.txt",ios:

:

app);

if(!

outfile)

{

cout<<"fcan'topen.\n";

abort();

}

outfile<<"TECHNICIAN"<

outfile<<"ID"<

}

voidprint()

{

cout<<"├─────┼─────┼─────┼─────┼─────┤"<

cout<<"│"<

<<"│"<

}

};

classsalesman:

virtualpublicemployee

{

protected:

floatcommrate;

floatsales;

public:

salesman(){commrate=0.04;}

voidinput(){cout<<"SALEMAN";employee:

:

input();}

voidsave()

{

fstreamoutfile;

outfile.open("f:

flsdfj.txt",ios:

:

app);

if(!

outfile)

{

cout<<"fcan'topen.\n";

abort();

}

outfile<<"TECHNICIAN"<

outfile<<"ID"<

}

voidpay()

{

cout<

";

cin>>sales;

salary=sales*commrate;

}

voidprint()

{

cout<<"├─────┼─────┼─────┼─────┼─────┤"<

cout<<"│"<

<

}

};

classsalesmanager:

virtualpublicmanager,virtualpublicsalesman

{

private:

floattotal;intno1,no2,no3,no4;charname1[8],name2[8],name3[8],name4[8];

floatsale1,sale2,sale3,sale4;

public:

voidsalemanager()

{

monthlypay=5000;

commrate=0.005;

}

voidinput(){cout<<"Salesmanger";employee:

:

input();}

voidsave()

{

fstreamoutfile;

outfile.open("f:

flsdfj.txt",ios:

:

app);

if(!

outfile)

{

cout<<"fcan'topen.\n";

abort();

}

outfile<<"Salesmanger"<

outfile<<"ID"<

}

voidsavesale()

{

fstreamoutfile;

outfile.open("f:

flsdfj.txt",ios:

:

app);

if(!

outfile)

{

cout<<"fcan'topen.\n";

abort();

}

outfile<<"Thesalaryofsalemanofsalesmangerandthemselves"<

outfile<<"ID"<

outfile<<"ID"<

outfile<<"ID"<

outfile<<"ID"<

}

voidpay()

{

cout<

";

salary=monthlypay+commrate*total;

}

floattotalsale(){total=sale1+sale2+sale3+sale4;returntotal;}

voidprinttotal()

{

cout<<"├─────┴──┬──┴─────┤"<

cout<<"│Total │  "<

cout<<"└────────┴────────┘"<

}

voidsort(salesmanagerp)

{

inttmp,i,j;

for(j=0;j<2;j++)

for(i=0;i<2;i++)

if(total

{

tmp=salary;

total=p.salary;

p.salary=tmp;

tmp=no;

no=p.no;

p.no=tmp;

}

}

voidsaler()

{

cout<<"StaffID:

";

cin>>no1;

cout<<"StaffNAME:

";

cin>>name1;

cout<<"Salesvolume:

";

cin>>sale1;

cout<<"StaffID:

";

cin>>no2;

cout<<"StaffNAME:

";

cin>>name2;

cout<<"Salesvolume:

";

cin>>sale2;

cout<<"StaffID:

";

cin>>no3;

cout<<"StaffNAME:

";

cin>>name3;

cout<<"Salesvolume:

";

cin>>sale3;

cout<<"StaffID:

";

cin>>no4;

cout<<"StaffNAME:

";

cin>>name4;

cout<<"Salesvolume:

";

cin>>sale4;

}

voidsaleprint()

{

cout<<"│"<

cout<<"├─────┼─────┼─────┤"<

cout<<"│"<

cout<<"├─────┼─────┼─────┤"<

cout<<"│"<

cout<<"├─────┼─────┼─────┤"<

cout<<"│"<

}

voidprint()

{

cout<<"├─────┼─────┼─────┼─────┼─────┤"<

cout<<"│"<

<

}

};

voidmain()

{

managerm[4];

techniciant[4];

salesmans[4];

salesmanagersm[4];

t[1].save();

intflag=1,operate;

do{

cout<<"####Thesystemofsalarymanger####\n";

cout<<"┌─────────────┐\n";

cout<<"│Choseyouractions│\n";

cout<<"│Input:

1,Enter│\n";

cout<<"│Total:

2,Enter│\n";

cout<<"│Output:

3,Enter│\n";

cout<<"│Save:

4,Enter│\n";

cout<<"│Exit:

5,Enter│\n";

cout<<"└─────────────┘\n";

cout<<"Pleasechoseoneaction:

";

cin>>operate;

switch(operate)

{

case1:

cout<<"Waitingforaminute!

"<

{

for(inti=0;i<4;i++)

{m[i].input();}

for(intj=0;j<4;j++)

{t[j].input();}

for(intk=0;k<4;k++)

{s[k].input();}

for(intl=0;l<4;l++)

{sm[l].input();}

};

{

for(inti=0;i<4;i++)

{m[i].pay();}

for(intj=0;j<4;j++)

{t[j].pay();}

for(intk=0;k<4;k++)

{s[k].pay();}

for(intl=0;l<4;l++)

{sm[l].pay();sm[l].saler();}

};break;

case2:

cout<<"Waitingforaminute!

"<

{

{

for(intl=0;l<4;l++)

sm[l].totalsale();

for(inti=0;i<4;i++)

for(intj=0;j<2;j++)

sm[j].sort(sm[j+1]);

};

cout<<"Thesalemanofthefirstsalesmanger"<

cout<<"┌─────┬─────┬─────┐"<

cout<<"│ ID │ NAME │SALARY│"<

sm[0].saleprint();

sm[0].printtotal();

cout<<"Theorderiscomplete"<

cout<<"Listnamesofeverysalesmanger"<

cout<<"┌─────┬─────┬─────┬─────┬─────┐"<

cout<<"│ ID │ NAME │ SEX  │ AGE  │SALARY │"<

for(intk=0;k<4;k++)

sm[k].print();

cout<<"└─────┴─────┴─────┴─────┴─────┘"<

};break;

case3:

cout<<"Waitingforaminute!

"<

{

cout<<"Theblankofthe:

"<

cout<<"┌─────┬─────┬─────┬─────┬─────┐"<

cout<<"│ ID │ NAME │ SEX  │ AGE  │SALARY │"<

for(inti=0;i<4;i++)

{m[i].print();}

cout<<"└─────┴─────┴─────┴─────┴─────┘"<

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2