




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#include#include#include#include#includeusing namespace std;class 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; 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) co
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 安阳疾控考试题库及答案
- 语文成教考试题库及答案
- 易班安全考试题库及答案
- 化工原理A2期末考试题库及答案
- 2025年锅炉水处理作业人员(特种作业)考试题库(含答案)
- 2025年新疆甜菜种植与农业技术推广应用合同
- 2025年贵州社区工作者考试备考题库及答案
- 浙江省高考试题及答案
- 港口督导员考试题及答案
- 水城县农机安全培训课件
- 2022燃煤机组耗差计算方法
- 食品公司原辅料及包装材料验收规范
- 新闻播读培训课件
- 《蔚来汽车发展》课件
- 装配钳工试题库及答案
- 新手必看保安证考试试题和答案
- 脓毒性休克护理要点
- 海洋空间资源开发与国家安全教学课件-2024-2025学年人教版(2019)高中地理选择性必修三
- 个人信息保护法亮点解读
- 《往复式压缩机制造监理技术要求》
- 《护士输血流程》课件
评论
0/150
提交评论