机房收费管理系统.docx

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

机房收费管理系统.docx

《机房收费管理系统.docx》由会员分享,可在线阅读,更多相关《机房收费管理系统.docx(22页珍藏版)》请在冰点文库上搜索。

机房收费管理系统.docx

机房收费管理系统

 

机房计费系统

 

编写人:

史淑娟、薛鑫

系别:

信息工程学院

专业:

3G软件开发

学号:

**************、

20110809050127

一系统设计任务内容

目前,在部分高校中,计算机机房的上机收费仍然采用传统的人工计时方式,即学生凭有效证件前来上机,由机房管理人员手工登记开始时间和结束时间,然后按实际机时进行计算并收取相应费用。

人工计时计费方式不但效率低,而且容易出错,也不利于定期的统计工作。

随着高校学生人数的不断增加,这些工作的难度和强度也不断加大,给机房管理部门带来了很大的压力。

具体任务如下:

题目:

机房收费管理系统

(1)输入功能:

输入30名学生的学号、班级、姓名、上机起始时间。

(2)计算功能:

计算每个下机学生的上机费用,每小时1元。

(上机费用=上机时间*1.0/h,不足一小时按一小时计算)

(3)查询功能:

按条件(班级、学号、姓名)显示学生的上机时间。

(4)机器使用情况的显示(显示方式不限但要一目了然)。

二详细设计

2.1系统总体模块图

系统的整体模块描述如图所示

图2-1系统总体模块图

2.2系统的功能模块划分

每一条记录包含一个学生学号、学生班级、学生姓名、上机起始时间,同时包含:

完成对学生上机时间的录入;按条件(班级、学号、姓名)显示学生的上机时间,计算每个下机学生的上机费用,并能根据学生的上机时间进行计算上机费用,而且还能显示机器使用情况。

2.3主要函数介绍

Main-menu函数:

输出机房管理系统菜单

Input函数:

输入若干学生的学号、班级和姓名及上机时间

Online函数:

学生上机,输入上机学生学号或姓名及时间

Calculator函数:

计算上机费用并输出

Offline函数:

学生下机时间,调用calculator函数得到上机费用

Search函数:

查找学生上机信息

Display函数:

显示全部机器的使用信息

Main函数:

函数调用以及结束程序

2.4系统程序代码及注释

2.4.1输入功能:

输入30名学生的学号、班级、姓名、上机起始时间

#include

#include

#include

#include

#defineN20

#defineM100

structstudent

{charid[N];

chartheclass[N];

charname[N];

charontime[N];

}

student[M];

intn;

voidaddition()

{inti;

printf("\n请输入录入学生信息的总数:

");

scanf("%d",&n);

for(i=1;i<=n;i++)

{printf("\n\t请输入第%d个学生学号(20s):

",i);

scanf("%s",student[i-1].id);

printf("\n\t请输入第%d个学生班级(20s):

",i);

scanf("%s",student[i-1].theclass);

printf("\n\t请输入第%d个学生姓名(20s):

",i);

scanf("%s",student[i-1].name);

printf("\n\t请输入第%d个学生上机时间(20s)(例:

02):

",i);

scanf("%s",student[i-1].ontime);

printf("\n\t提示:

您已成功录入第%d条信息\n",i);

}

}

2.4.2计算功能:

计算每个下机学生的上机费用,每小时1元。

(上机费用=上机时间*1.0/h,不足一小时按一小时计算)

voidcalculate()

{inthours;

chartimes[30];

time_trawtime;

structtm*timeinfo;

time(&rawtime);

timeinfo=localtime(&rawtime);

strcpy(times,asctime(timeinfo));

printf("\t所有学生上机费用如下:

\n");

for(inti=1;i<=n;i++)

{printf("学生%d费用:

",i);if((student[i-1].ontime[3]-48)*10+student[i-1].ontime[4]>(times[14]-48)*10+times[15])hours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1];

elsehours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1]+1;

printf("%d\n",hours);

}

}

voidcalculate()

{inthours;

chartimes[30];

time_trawtime;

structtm*timeinfo;

time(&rawtime);

timeinfo=localtime(&rawtime);

strcpy(times,asctime(timeinfo));

printf("\t所有学生上机费用如下:

\n");

for(inti=1;i<=n;i++)

{printf("学生%d费用:

",i);if((student[i-1].ontime[3]-48)*10+student[i-1].ontime[4]>(times[14]-48)*10+times[15])hours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1];

elsehours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1]+1;

printf("%d\n",hours);

}

}

2.4.3查询功能:

按条件(班级、学号、姓名)显示学生的上机时间。

voidsearch()

{inti,b,c,count;

do

{charfind[20];

printf("\n请选择查询方式:

1.根据学号查询;2.根据班级查询;3.根据姓名查询;4.根据上机时间:

");

scanf("%d",&b);

switch(b)

{case1:

count=PF_FLOATING_POINT_PRECISION_ERRATA;printf("\n**请输入学生的学号:

");

scanf("%s",find);

for(i=0;i

{if(strcmp(student[i].id,find)==0)

{count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)

printf("****提示:

该生不存在");

gotoA;

case2:

count=PF_FLOATING_POINT_PRECISION_ERRATA;

printf("\n**请输入学生的班级:

");

scanf("%s",find);

for(i=0;i

{if(strcmp(student[i].theclass,find)==0)

{count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)

printf("****提示:

该生不存在");

gotoA;

case3:

count=PF_FLOATING_POINT_PRECISION_ERRATA;

printf("\n**请输入学生的姓名:

");

scanf("%s",find);

for(i=0;i

{

if(strcmp(student[i].name,find)==0)

{

count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)printf("****提示:

该生不存在");

gotoA;

case4:

count=PF_FLOATING_POINT_PRECISION_ERRATA;

printf("\n**请输入学生的上机时间:

");

scanf("%s",find);

for(i=0;i

{if(strcmp(student[i].ontime,find)==0)

{count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)

printf("****提示:

该生不存在");

gotoA;

default:

printf("*****提示:

输入错误");

}

A:

printf("\n\t**1.继续\n\t**0.返回主菜单");

printf("\n\t请输入您的选择:

");

scanf("%d",&c);

}

while(c);

}

2.4.4机器使用情况的显示

voidmenu()

{

printf("\n\t*******************欢迎进入机房收费管理系统!

*******************\n");

printf("\t*1.录入功能2.计算功能*\n");

printf("\t*3.查询功能0.-*EXIT*-*\n");printf("\t***************************************************************\n");

printf("\n\t请输入您的选择:

");

}

voidmain()

{system("color5f");

inta;

C:

menu();

scanf("%d",&a);

switch(a)

{

case0:

printf("***正在退出**谢谢使用本系统,再见");break;

case1:

addition();

gotoC;

/*录入功能*/

case2:

calculate();

gotoC;/*浏览功能*/

case3:

search();

gotoC;/*查询功能*/}}

 

三软件使用说明

3.1录入系统

图3-1输入30名学生的学号、班级、姓名、上机起始时间

3.2计算功能

图3-2计算每个下机学生的上机费用

3.3查询功能

图3-3按条件(班级、学号、姓名)显示学生的上机时间

3.4机器使用情况

图3-4机器使用情况查询

四课程设计心得与体会

在为期三周的课程设计中,我体会颇多,学到很多东西。

我加强了对C++的认识,复习了自己以前的知识,自己的逻辑思考能力也提高不少。

从而对MicrosoftVisualC++6.0又有了更深入的认识!

在这次课程设计中,我还懂得了程序开发的一些比较重要的步骤,比如需求分析、总体设计、程序模块设计(含功能需求、程序代码设计与分析、运行结果)、系统使用说明等。

总之,通过这次课程设计,我收获颇丰,相信会为自己以后的学习和工作带来很大的好处。

最重要的还是激发了我编程的兴趣和热情,让我从一个只懂理论变成了能做一些小型程序,让我对编程更加热爱了。

整体地评价这次课程设计,我认为收获很大,正如上面所说的那样,通过课程设计,既复习了以前的旧知识,又学到了一些新的知识;设计增强了我们用所学知识去解决具体问题的能力,进一步培养了我们独立思考问题和解决问题的能力。

特别是学会了在VisualC++集成开发环境中如何调试程序的方法。

当然,老师的悉心指导和同学的帮助也是不可忽视的,在此感谢本次课程设计中辅导老师对我的关心和帮助,诚心诚意感谢她对我的鼓励与教导,是她在我迷茫的时候给了我些许提示,激发了我编程的灵感;还有,我在此也十分感谢本次课程设计中同学们对我的帮助,尽管本次不是团队合作,但是他们也给了我不少的提示和帮助,是他们让我有信心坚持做下来,在此感谢他们!

附录一:

参考文献

[1]谭浩强.C++语言程序设计,清华大学出版社.

[2]谭浩强.C语言程序设计(第二版),清华大学出版社,1992.

[3]张雨,阮伟良等.visualC++工程应用与项目实践.机械工业出版社,2005.

[4]明日科技.管理信息系统完整项目实例剖析,人民邮电出版社,2005

附录二:

程序清单

#include

#include

#include

#include

#defineN20

#defineM100

structstudent

{charid[N];

chartheclass[N];

charname[N];

charontime[N];

}

student[M];

intn;

voidaddition()

{inti;

printf("\n请输入录入学生信息的总数:

");

scanf("%d",&n);

for(i=1;i<=n;i++)

{printf("\n\t请输入第%d个学生学号(20s):

",i);

scanf("%s",student[i-1].id);

printf("\n\t请输入第%d个学生班级(20s):

",i);

scanf("%s",student[i-1].theclass);

printf("\n\t请输入第%d个学生姓名(20s):

",i);

scanf("%s",student[i-1].name);

printf("\n\t请输入第%d个学生上机时间(20s)(例:

02):

",i);

scanf("%s",student[i-1].ontime);

printf("\n\t提示:

您已成功录入第%d条信息\n",i);

}

}

(上机费用=上机时间*1.0/h,不足一小时按一小时计算)

voidcalculate()

{inthours;

chartimes[30];

time_trawtime;

structtm*timeinfo;

time(&rawtime);

timeinfo=localtime(&rawtime);

strcpy(times,asctime(timeinfo));

printf("\t所有学生上机费用如下:

\n");

for(inti=1;i<=n;i++)

{printf("学生%d费用:

",i);if((student[i-1].ontime[3]-48)*10+student[i-1].ontime[4]>(times[14]-48)*10+times[15])hours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1];

elsehours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1]+1;

printf("%d\n",hours);

}

}

voidcalculate()

{inthours;

chartimes[30];

time_trawtime;

structtm*timeinfo;

time(&rawtime);

timeinfo=localtime(&rawtime);

strcpy(times,asctime(timeinfo));

printf("\t所有学生上机费用如下:

\n");

for(inti=1;i<=n;i++)

{printf("学生%d费用:

",i);if((student[i-1].ontime[3]-48)*10+student[i-1].ontime[4]>(times[14]-48)*10+times[15])hours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1];

elsehours=(times[11]-48)*10+times[12]-(student[i-1].ontime[0]-48)*10-student[i-1].ontime[1]+1;

printf("%d\n",hours);

}

}

voidsearch()

{inti,b,c,count;

do

{charfind[20];

printf("\n请选择查询方式:

1.根据学号查询;2.根据班级查询;3.根据姓名查询;4.根据上机时间:

");

scanf("%d",&b);

switch(b)

{case1:

count=PF_FLOATING_POINT_PRECISION_ERRATA;printf("\n**请输入学生的学号:

");

scanf("%s",find);

for(i=0;i

{if(strcmp(student[i].id,find)==0)

{count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)

printf("****提示:

该生不存在");

gotoA;

case2:

count=PF_FLOATING_POINT_PRECISION_ERRATA;

printf("\n**请输入学生的班级:

");

scanf("%s",find);

for(i=0;i

{if(strcmp(student[i].theclass,find)==0)

{count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)

printf("****提示:

该生不存在");

gotoA;

case3:

count=PF_FLOATING_POINT_PRECISION_ERRATA;

printf("\n**请输入学生的姓名:

");

scanf("%s",find);

for(i=0;i

{

if(strcmp(student[i].name,find)==0)

{

count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)printf("****提示:

该生不存在");

gotoA;

case4:

count=PF_FLOATING_POINT_PRECISION_ERRATA;

printf("\n**请输入学生的上机时间:

");

scanf("%s",find);

for(i=0;i

{if(strcmp(student[i].ontime,find)==0)

{count++;

if(count==PF_FLOATING_POINT_EMULATED)

printf("学生学号\t学生班级\t学生姓名\t上机时间\n");printf("%8s%15s%15s%17s",student[i].id,student[i].theclass,student[i].name,student[i].ontime);

}

}

if(!

count)

printf("****提示:

该生不存在");

gotoA;

default:

printf("*****提示:

输入错误");

}

A:

printf("\n\t**1.继续\n\t**0.返回主菜单");

printf("\n\t请输入您的选择:

");

scanf("%d",&c);

}

while(c);

}

voidmenu()

{

printf("\n\t*******************欢迎进入机房收费管理系统!

*******************\n");

printf("\t*1.录入功能2.计算功能*\n");

printf("\t*3.查询功能0.-

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

当前位置:首页 > 法律文书 > 调解书

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

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