C++机房计费管理系统.docx

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
选择填空题(共 选择填空题(共20小题,每小题2分,共40分) 页脚内容 页脚内容 PAGE # 目录 TOC \o 1-5 \h \z 一、需求分析 22 二、概要设计 22 \o Current Document 电脑库类的定义: 25 \o Current Document 三、详细设计 26 \o Current Document 学生类成员函数的定义: 26 Student二Student() // 构造函数 26 {} 26 void Student二upcom(char Name[20],int Cla,int Stunum,int Comnum)上机 26 { 26 strcpy(name,Name); 26 tag=1; 26 cla=Cla; 26 stunum=Stunum; 26 comnum=Comnum; 26 stime=gettime(); 26 } 26 int Student二downcom() // 下机 26 { 26 //otime=gettime(); 27 setotime(); 27 delstu(); 27 disp(); 27 return comnum; 27 } 27 void Student二delstu()〃 更改上机标记 27 { 27 tag=0; 27 } 27 void Student二setotime()// 获取下机时间 27 { 27 otime=gettime(); 27 } 27 time_t Student二gettime()// 获取当前时间 27 { 27 return time(NULL); 28 } 28 char* Student二getname()// 获取姓名 28 { 28 return name; 28 } 28 int Student二getcla()// 获取班级 28 { 28 return cla; 28 } 28 int Student二gettag()// 获取上机标记 28 { 28 return tag; 28 } 28 int Student二getstunum() // 获取学号 28 { 28 return stunum; 29 } 29 int Student二getcomnum() // 获取上机号 29 { 29 return comnum; 29 } 29 double Student二countht() // 计算总上机时间 29 { 29 return difftime(otime,stime); 29 } 29 int Student二countm()// 计算上机费用 29 { 29 if(((int)countht())%3600==0) 29 return ((int)countht())/3600; 29 return ((int)countht()/3600)+1; 29 } 29 void Student二disp()〃 显示 30 { 30 cout姓名:name 班级:cla 学号:stunum 上机号 comnumendl; 30 cout”开始上机时间:asctime(localtime(stime)) 上机总时间: countht()/3600.00小时 上机费用:countm()元endl; 30 } 30 void Student二disp2()〃 显示 30 { 30 coutendlendl ——上机成功——endl; 30 cout姓名:nameendl班级:claendl学号:stunumendl”开始上机 时间:asctime(localtime(stime))上机号:comnumendl; 30 //cout”开始上机时间:stime 上机总时间:countht() 上机费用: countm()endl; 30 } 30 \o Current Document 学生库类成员函数定义: 30 StuData::StuData() // 构造函数,将 student.txt中的内容读至U student[# 30 { 31 Student s; 31 top=-1; 31 ifstream fin(student.txt); 31 while(1) 31 { 31 fin.read((char *)s,sizeof(s)); 31 if(!fin) 31 break; 31 top++; 31 student[top]=s; 31 } 31 fin.close(); 31 } 31 Student* StuData二searchnum(int Stunum)按学号搜索 31 { 31 for(int i=0;

文档评论(0)

152****9471 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6154030023000021

1亿VIP精品文档

相关文档