机房收费管理系统C程序设计报告Word下载.docx
- 文档编号:14334457
- 上传时间:2022-10-22
- 格式:DOCX
- 页数:23
- 大小:57.26KB
机房收费管理系统C程序设计报告Word下载.docx
《机房收费管理系统C程序设计报告Word下载.docx》由会员分享,可在线阅读,更多相关《机房收费管理系统C程序设计报告Word下载.docx(23页珍藏版)》请在冰豆网上搜索。
charIbname[20];
IbStudent;
IbStudentlbstu[50];
structIbcomputer
{intIbf;
IbStudentIbstut;
}lbcom[30];
intIbk;
intlbmain_menu()
{charIbc;
do
system("
cls"
);
coutvv"
\t\t\t****机房收费管理系统****\n"
«
"
\t\t\t1.输
入学生信息\n"
vv"
\t\t\t2.上机\n"
\t\t\t3.下机\n"
\t\t\t4.查询上机时间\n"
<
\t\t\t5.机器使用情况显示
\n"
\t\t\tO.退出系统
\n"
v"
\t\t\t************************\n"
\t\t\t
请选择
菜单(0-5):
lbc=getchar();
}
while(lbcv'
0'
||lbc>
'
5'
return(lbc-'
intlbi=0;
charIbsign='
O'
;
while(lbsign!
二'
lbn'
&
Ibsign!
IbN'
)
getchar();
cout«
\t\t学号:
gets(lbstu[lbn+qhi]」bnum);
cout<
\t\t班级:
cin>
>
lbstu[lbn+lbi]」bbanji;
\t\t姓名:
gets(lbstu[lbn+lbi]」bname);
\t\t继续输入?
是请按Y,否请按N:
lbsign;
lbstu[lbn+qhi].lbflag=0;
lbi++;
}
return(lbn+lbi);
charIbnum_t[20],lbname_t[20];
intlbi,lbs;
\t\t使用姓名按1使用学号按2:
lbs;
while(lbs!
=1&
Ibs!
=2);
if(lbs==1)
\t\t请输入姓名:
gets(lbname_t);
for(lbi=0;
lbi<
lbn;
lbi++)
if(strcmp(lbstu[lbi]」bname,lbname_t)==0)
break;
else
\t\t请输入学号:
gets(lbnum_t);
if(strcmp(lbstu[lbi]」bnum,lbnum_t)==O)
if(lbi==lbn)
\t\t信息库中暂无该生,请输入该生信息再上机!
return;
elseif(lbstu[lbi].lbflag==1)
\t\t该生正在上机!
\n"
return;
for(lbk=0;
lbk<
30;
lbk++)
if(lbcom[lbk].lbf==0)
lbcom[lbk].lbf=1;
\t\t请输入上机时间(当前时间):
lbstu[lbi]」bstart」bhour>
>
lbstu[lbi]」bstart」bminute>
lbstu[lbi]」bstart」bsecond;
lbstu[lbi].lbflag=1;
lbcom[lbk]」bstut=lbstu[lbi];
break;
if(lbk==30)
\t\t机器全部使用中,请稍后再上机!
2、计算功能
voidlbcalculate(lbStudentlbstu){
intlbt;
structlbtimelbtimet;
if(lbstu.lbfinish.lbsecond<
lbstu.lbstart.lbsecond)
{if(lbstu」bfinish」bminute==0)
{lbstu.lbfinish.lbhour-=1;
lbstu」bfinish」bminute=59;
lbstu」bfinish」bminute-=1;
Ibtimet.lbsecond=lbstu」bfinish.lbsecond+60-lbstu」bstart.
Ibsecond;
lbtimet.lbsecond=lbstu.lbfinish.lbsecond-lbstu.lbstart.lbsecond;
if(lbstu.lbfinish.lbminute<
lbstu.lbstart.lbminute)
lbstu」bfinish」bhour-=1;
lbtimet.lbminute=lbstu.lbfinish.lbminute+60-lbstu」bstart」bmi
nute;
lbtimet.lbminute=lbstu.lbfinish.lbminute-lbstu.lbstart.lbmi
lbtimet.lbhour=lbstu.lbfinish」bhour-lbstu」bstart」bhour;
if(lbtimet.lbsecond==0&
Ibtimet.lbminute==0)lbt=lbtimet.lbhour;
lbt=lbtimet.lbhou叶1;
\t\t该生上机用时%d小时,费用为%d元
3、查询功能
voidIboffline(lbStudentlbstu[],intIbn)
}while(lbs!
qhi<
if(strcmp(lbstu[lbi].lbname,lbname_t)==0)
\t\t没有这个学生!
elseif(lbstu[lbi].lbflag==O)
\t\t该生未上机或已下机!
}else
\t\t请输入下机时间(当前时间):
;
lbstu[lbi].Ibfinish.lbhour>
lbstu[lbi].Ibfinish.lbminute>
lbstu[lbi]」bfinish」bsecond;
lbcalculate(lbstu[qhi]);
lbstu[lbi].lbflag=O;
3;
if(strcmp(lbcom[lbk]」bstut.lbnum,lbstu[lbi].bnum)==0){
lbcom[lbk].lbf=0;
voidlbsearch(lbStudentlbstu[],intIbn){
qhs!
bi++)
\t\t查无此生!
\t\t该生正在上机,上机起始时间
为%d:
%d:
%d\n"
lbstu[lbi].lbstart.lbhour,lbstu[lbi].lbstart.lbmi
nute,lbstu[lbi]」bstart」bsecond;
4、机器使用情况的显示
voiddisplay()
\t机器号是否使用使用者学号班级上机时
间\n"
\t\n"
\t%02d否——:
--:
--\n"
qhk+1;
yes"
v<
endl;
Ibcom[lbk]」bstut.lbname,lbcom[lbk]」bstut.lbnum,lbcom[l
bk].lbstut.lbbanji,lbcom[lbk].lbstut.lbstart.lbhour,
lbcom[lbk].lbstut.lbstart.lbminute,lbcom[lbk].lbstut.lbstart」bsecond;
\t"
pause"
1总体结构图
2主函数程序流程图
3子函数程序流程图
1输入学生信息
2学生上机
3学生下机
net
HuiLipl^x
.i«
4>
Lhit!
C«
_«
Ldg”..
t
1
i
II
MullipLei
I
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 机房 收费 管理 系统 程序设计 报告