已阅读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年武警南京医院医护人员招聘笔试试题及答案详解
- 2026内蒙古呼伦贝尔市人力资源和社会保障局所属事业单位竞争性比选人员1人笔试参考题库及答案详解
- 2025年大屯煤电集团公司职工中心医院医护人员招聘笔试试题及答案详解
- 2026河北邢台市隆尧县公益性岗位人员招聘6人笔试模拟试题及答案详解
- 2026年张家口市第二医院医护人员招聘笔试备考题库及答案解析
- 断桥铝合金门窗施工方案
- 公园物业日常保洁服务执行方案
- 二级造价工程师安装工程考试真题及答案解析
- 宠物食品加工厂实施方案
- 道路挖掘施工方案设计
- 97G329-8建筑抗震结构详图(钢筋砼柱单层厂房)图集
- 省级行业产教融合共同体申报书、申报书、参与建设证明
- JJG 241-2002精密杯形和U形液体压力计
- T-SHNA 0003-2023 消化内镜诊疗前消化道准备
- DB21-T 2819-2017岩土工程勘察报告编制规范
- 幼儿教育学心理学复习资料
- 《铁道车辆制动装置及制动新技术》 课件 7.2货车脱轨自动制动装置的检修工艺流程
- JGT266-2011 泡沫混凝土标准规范
- (完整版)医疗器械网络交易服务第三方平台质量管理文件
- 深圳市社会保险定点医疗机构医疗服务协议书共207课件
- 脐灸专业知识课件
评论
0/150
提交评论