




已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
程序设计综合实训报告(清考)学院:华师传媒专业:计算机应用姓名:石肖学号:09305050245程序设计综合实训报告(清考)课程名称程序设计综合实训班 级02实训日期2011.11.2姓 名石肖学 号09305050245实训成绩名 称程序设计综合实训报告(清考)实验目的及要求掌握 Visual C+集成环境下调试标准C+程序的方法实验环境Visual C+集成环境、Windows 7 操作系统实验内容用C+语言开发“简单的学生成绩管理系统”。 算法描述及实验步骤#include#include#include#include#includeclass student private: char name20; /姓名 double cpro,english,math,sport,law,hbpro,computer;/课程 int order, number; /名次,学号 public: student() student(char n20,int nu,double cc,double eng,double ma,double sp,double l,double hb,double com) strcpy(name,n); number=nu; cpro=cc; english=eng;math=ma;sport=sp;law=l;hbpro=hb;computer=com; friend void main();void main() cout 欢迎进入*学生成绩管理系统*!endl; cout *endl; cout * 学生成绩管理系统 *endl; cout *endl; cout *endl; cout *0、输入数据 *endl; cout *1、增加数据 *endl; cout *2、修改数据 *endl; cout *3、按姓名查询 *endl; cout *4、按学号查询 *endl; cout *5、输出所有学生的成绩 *endl; cout *6、退出系统 *endl; cout *endl; cout 选择0-6数字进行操作p; if(p=0&p=6) flag=1; else cout 指令错误!请重新输入:endl; while(flag=0); do switch(p) /接收功能选项 case 0: /输入数据 char c; char name20;int number;double cpro,english,math,sport,law,hbpro,computer; do coutname; coutendlnumber; coutcpro; coutendlenglish; coutendlmath; coutendlsport; coutendllaw; coutendlhbpro; coutendlcomputer; coutendl;filej=new ofstream(D:document,ios:ate); *filej 姓名 name 学号 number C+成绩 cpro 英语成绩 english 数学成绩 math 体育成绩 sport 网络基础成绩 law C成绩 hbpro 数据库成绩 computerendl; j+; si=new student(name, number,cpro,english,math,sport,law,hbpro,computer); i+; coutc; coutendl; do if(c!=y&c!=n) cout 指令错误!请重新输入!endlc; else flag=1; while(flag=0); while(c=y); break; case 1: /增加数据 char name20; int number;double cpro,english,math,sport,law,hbpro,computer;char c;do coutname; coutendlnumber; coutendlcpro; coutendlenglish; coutendlmath; coutendlsport;cinsport; coutendllaw; coutendlhbpro; coutendlcomputer; coutendl; filej=new ofstream(d:document,ios:ate); *filej 姓名 name 学号 number C+成绩 cpro 英语成绩 english 数学成绩 math 体育成绩 sport 网络基础成绩 law C成绩 hbpro 数据库成绩 computerendl; j+; si=new student(name, number, cpro,english,math,sport,law,hbpro,computer); i+; coutc; coutendl; if(c!=y&c!=n) cout 指令错误!请重新输入!endlc; while(c=y); break; case 2: /修改数据 char name20;int nu;double cc,eng,ma,sp,l,hb,com;flag=0; char c; if(i=0) cout 管理系统中没有输入数据!endl;break; do coutname; coutendl;for(int h=0;hname)=0) flag=1; coutnu; coutendlcc; coutendleng; coutendlma; coutendlsp; coutendll; coutendlhb; coutendlcom; coutcpro=cc; sh-english=eng; sh-math=ma; sh-sport=sp; sh-law=l; sh-hbpro=hb; sh-computer=com; sh-number=nu; cout 数据修改成功!endl; if(flag=0) cout 您要修改的学生本来就不存在!请检查重新输入!endl; coutc; coutendl; if(c!=y&c!=n) cout 指令错误!请重新输入!endlc; while(c=y); break; case 3: /按姓名查询 char n20;int j=0;char c; if(i=0) cout 管理系统中没有输入数据!endl;break; do int flag=0; coutn; coutendl; for(int j=0;ji;j+) if(strcmp(n,(*sj).name)=0) flag=1; cout 您要查询的学生是:(*sj).nameendl; cout(*sj).name的成绩是: C+: (*sj).cpro 英语: (*sj).english 数学:(*sj).math 体育:(*sj).sport 法律:(*sj).law C:(*sj).hbpro 数据库 (*sj).computerendl; if(flag=0) cout 对不起!您要查询的学生不存在!endl; coutc; coutendl; if(c!=y&c!=n) cout 指令错误!请重新输入!c; while(c=y); break; case 4: /按学号查询 int n,j=0;char c; if(i=0) cout 管理系统中没有输入数据!endl;break; do int flag=0; coutn; coutendl; for(int j=0;jnumber=n) flag=1; cout 您要查询的学生是:(*sj).nameendl; cout(*sj).name的成绩是: C+:(*sj).cpro 英语:(*sj).english 数学:(*sj).math 体育:(*sj).sport 法律:(*sj).law C:(*sj).hbpro 数据库 (*sj).computerendl; if(flag=0) cout 对不起!您要查询的学生不存在!endl; coutc; coutendl; if(c!=y&c!=n) cout 指令错误!请重新输入!c; while(c=y); break; case 5: /输出 cout 本系统所有学生数据如下:endl; if(i=0)cout 管理系统中没有输入数据!endl; cout 姓名 学号 c+ 英语 数学 体育 网络基础 C语言 数据库 endl; for(int k=0;ki;k+) coutnamesetw(7)numbersetw(6) (*sk).cprosetw(6)(*sk).englishsetw(6) (*sk).mathsetw(6)(*sk).sportsetw(7) (*sk).law setw(10)(*sk).hbprosetw(10)(*sk).computersetw(10)endl; break; case6:/退出 exit(0); coutBye bye!endl;coutw; coutendl; if(w!=y&w!=n) cout 指令错误!请重新输入!endl; else flag=1;while(flag=0);if(w=y)cout
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年航空机械员考试题库及答案
- 外贸销售合同样本中英文
- 高温工程施工合同(3篇)
- 安全员往年考试题及答案
- 安全卫生考试试题及答案
- 安全师考试题及答案
- 安保公司培训考试题及答案
- 痔疮动脉结扎微创技术-洞察及研究
- 2025河北公务员面试题及答案
- 2025国考行测模考试题及答案
- 关联交易贷款管理办法
- 湖南第一师范学院《高等数学》2024-2025学年期末试卷(A卷)含答案
- DB42T 1342-2018 小型沼气工程设计、施工及验收规范
- 2025至2030全球及中国内容营销平台行业产业运行态势及投资规划深度研究报告
- 微商课件培训
- 2025年国家网络安全宣传周知识竞赛考试题库
- 网约车考试全国公共科目考题及答案
- 水电厂自动化管理制度
- 2025版标准劳动合同模板下载
- 小学生游泳队训练计划
- 2024从“小众运动”到“全民热潮”解码网球人群与市场机遇
评论
0/150
提交评论