大学生综合测评系统(C++)

#include<iostream>
#include<fstream>
#include<string>
#include<iomanip>
using namespace std;
char press;int choose=1;int n;
class Student
{protected:int num;//学号string name;//姓名string sex;//性别string address;//家庭住址string phone;//联系电话
public:Student *next;Student(){}void daochu();void info_xiugai(Student *head);void info_del(Student *head);void info_input(Student *head);void info_charu(Student *head);void info_show(Student *head);void info_save(Student *head);void info_paixu(Student *head);
};
class data:public Student
{private:double english;//英语成绩double math;//数学成绩double chinese;//物理分数double average;//考试成绩double grade1;//同学互评分double grade2;//品德成绩double grade3;//任课教室评分double ceping;//综合测评成绩int ranking1;//考试名次int ranking2;//综合测评名次  data *next;data *first;
public:void data_input(data *h);  void data_xieru(data *h);void data_chaxun(data *h);
};
Student *head=new Student;
Student *tail,*p,*q;
data *h=new data;
//---------------------------显示学生信息-------------------------------
void Student::info_show(Student *head)
{char content[50];char filename[20];cout<<"从文件中读取信息!"<<endl;cout<<"请输入文件名:"<<endl;cin>>filename;cout<<"正在导入中........"<<endl;ifstream infile;infile.open(filename,ios::in|ios::out);if(!infile){cerr<<"open error!"<<endl;exit(1);}cout<<"导入成功"<<endl; while(infile.peek()!=EOF){infile.getline(content,50);cout<<content<<endl;}infile.close();
}
//----------------保存学生信息------------------
void Student::info_save(Student *head)
{int i;Student *p=head->next;char filename[20];cout<<"将记录保存在文件夹!"<<endl;cout<<"请输入文件名:";cin>>filename;ofstream outfile(filename);if(!outfile){cerr<<"open error!"<<endl;}while(p){outfile<<p->num<<" "<<p->name<<" "<<p->sex<<" "<<p->address<<" "<<p->phone<<endl;p=p->next;}outfile.close();cout<<"保存成功!"<<endl;
}
//----------------输入学生资料------------------
void Student::info_input(Student *head)
{Student *q,*p,*tail;head->next=NULL;tail=NULL;q=head;cout<<"请根据你的需要输入学生的个数:";cin>>n;for(int a=0;a<n;a++){p=new Student;cout<<"请输入第"<<a+1<<"个学生资料:"<<endl;cout<<"学号:"<<' ';cin>>p->num;cout<<"姓名:"<<' ';cin>>p->name;cout<<"性别:"<<' ';cin>>p->sex;cout<<"家庭住址:"<<' ';cin>>p->address;cout<<"联系方式:"<<' ';cin>>p->phone;p->next=NULL;q->next=p;q=p;}cout<<"输入成功,正在排序中......"<<endl;while((head->next->next)!=tail){q=head;p=head->next;while(p->next!=tail){if((p->num)<(p->next->num)){q->next=p->next;p->next=p->next->next;q->next->next=p;p=q->next;}p=p->next;q=q->next;}tail=p;}cout<<"排序成功!"<<endl;
}
//----------------删除资料------------------
void Student::info_del(Student *head)
{Student *p,*q,*tail;tail=NULL;q=head;p=head->next;cout<<"请输入你要删除的学生学号:"<<endl;int i=0;cin>>n;while(p) {if(n==p->num) {q->next=p->next;delete(p);cout<<"删除成功"<<endl;break;}q=p;p=p->next;}       cout<<"请稍等,正在排序中......"<<endl;while((head->next->next)!=tail){q=head;p=head->next;while(p->next!=tail){if((p->num)<(p->next->num)){q->next=p->next;p->next=p->next->next;q->next->next=p;p=q->next;}p=p->next;q=q->next;}tail=p;}                                                 cout<<"排序成功!"<<endl;p=head->next;cout<<"---------------------------------------------------"<<endl;while(p) {cout<<p->num<<"    "<<p->name<<"    "<<p->sex<<"    "<<p->address<<"    "<<p->phone<<endl;p=p->next;}
}
//----------------添加学生信息------------------
void Student::info_charu(Student *head)
{Student *p,*q,*node,*tail;tail=NULL;cout<<"请输入要在哪个学号之后插入信息: "<<endl;cin>>n;node=new Student;                                                                                                                                                                                                    cout<<"请输入插入学生的学号,姓名,性别,家庭住址和电话号码"<<endl;cin>>node->num>>node->name>>node->sex>>node->address>>node->phone;p=head->next;q=head;while(q) {q=p;if(p->num==n) {break; }if(p->num==node->num){printf("输入的学号重复"); system("pause");info_charu(head); }p=p->next;}node->next=NULL;node->next=q->next;q->next=node;cout<<"插入成功,正在排序中......"<<endl;while((head->next->next)!=tail){q=head;p=head->next;while(p->next!=tail){if((p->num)<(p->next->num)){q->next=p->next;p->next=p->next->next;q->next->next=p;p=q->next;}p=p->next;q=q->next;}tail=p;}cout<<"排序成功!"<<endl;p=head->next;cout<<"---------------------------------------------------"<<endl;while(p) {cout<<p->num<<"    "<<p->name<<"    "<<p->sex<<"    "<<p->address<<"    "<<p->phone<<endl;p=p->next;}system("pause");system("cls");
}
void Student::info_xiugai(Student *head)
{                                     //修改学生信息Student *p,*q;cout<<"输入要修改信息的学号"<<endl;cin>>n;p=head->next;q=head;while(p) {if(p->num==n) {cout<<p->num<<"    "<<p->name<<"    "<<p->sex<<"    "<<p->address<<"    "<<p->phone<<endl;printf("\t请输入姓名::");cin>>p->name;printf("\t请输入性别:");cin>>p->sex;printf("\t请输入家庭住址::");cin>>p->address;printf("\t请输入电话号码:");cin>>p->phone;printf("\n\t修改成功!\n\n");}q=p;p=p->next;}p=head->next;cout<<"---------------------------------------------------"<<endl;while(p) {cout<<p->num<<"    "<<p->name<<"    "<<p->sex<<"    "<<p->address<<"    "<<p->phone<<endl;p=p->next;}system("pause");system("cls");
}
void data::data_input(data *h)
{int c=0;data *p,*q;q=h; char filename[20];cout<<"从文件中读取信息!"<<endl;cout<<"请输入文件名:"<<endl;cin>>filename;cout<<"正在导入中........"<<endl;ifstream infile;infile.open(filename,ios::in|ios::out);if(!infile){cerr<<"open error!"<<endl;exit(1);}while(infile.peek()!=EOF&&!infile.eof()){p=new data;infile>>p->num>>p->name>>p->sex>>p->address>>p->phone;q->next=p;p->next=NULL;q=p;c++;}infile.close();cout<<"读取成功!"<<endl;cout<<"共读取"<<c-1<<"条记录"<<endl; p=h->next;for(int i=1;i<c;i++){cout<<"学号:   "<<p->num<<"    "<<"姓名:   "<<p->name<<endl;cout<<"语文成绩:"<<' ';cin>>p->chinese;cout<<"高数成绩:"<<' ';cin>>p->math;cout<<"英语成绩:"<<' ';cin>>p->english;cout<<"同学互评分:"<<' ';cin>>p->grade1;cout<<"品德成绩:"<<' ';cin>>p->grade2;cout<<"任课教师评分:"<<' ';cin>>p->grade3;p->average=(p->chinese+p->math+p->english)/3.0;p->ceping=(p->average*0.6+p->grade1*0.1+p->grade2*0.1+p->grade3*0.2);p=p->next;q=p;}cout<<"输入已完成,正在排名中........"<<endl;data *tail;tail=NULL;while((h->next->next)!=tail){q=h;p=h->next;while(p->next!=tail){if((p->ceping)<(p->next->ceping)){q->next=p->next;p->next=p->next->next;q->next->next=p;p=q->next;}p=p->next;q=q->next;}tail=p;}p=h->next;int i=1;while(p){p->ranking2=i;i++;p=p->next;}cout<<"排名已完成,正在保存中........"<<endl;char filename1[20];cout<<"将记录保存在文件夹!"<<endl;cout<<"请输入文件名:";cin>>filename1;p=h->next;ofstream outfile(filename1);if(!outfile){cerr<<"open error!"<<endl;}for(int i=1;i<c;i++){outfile<<"学号:"<<p->num<<' '<<"姓名:"<<p->name<<' '<<"性别:"<<p->sex<<' '<<"家庭地址:"<<p->address<<' '<<"联系方式:"<<p->phone<<' '<<"语文成绩:"<<p->chinese<<' '<<"高数成绩:"<<p->math<<' '<<"英语成绩:"<<p->english<<' '<<"同学互评分:"<<p->grade1<<' '<<"品德成绩:"<<p->grade2<<' '<<"任课教师评分:"<<p->grade3<<"综合测评名次"<<p->ranking2<<endl;p=p->next;}outfile.close();cout<<"保存成功!"<<endl;system("pause");system("cls");
}
void data::data_chaxun(data *h)
{data *p,*q;q=h;p=h->next;int find_num;cout<<"请输入你要查询的学号:"<<' ';cin>>find_num;int i;while(p){if(p->num==find_num)                  {cout<<"学号为"<<p->num<<"的学生的资料已找到:"<<endl;cout<<"学号:"<<p->num<<' '<<"姓名:"<<p->name<<' '<<"性别:"<<p->sex<<' '<<"家庭地址:"<<p->address<<' '<<"联系方式:"<<p->phone<<' '<<"语文成绩:"<<p->chinese<<' '<<"高数成绩:"<<p->math<<' '<<"英语成绩:"<<p->english<<' '<<"同学互评分:"<<p->grade1<<' '<<"品德成绩:"<<p->grade2<<' '<<"任课教师评分:"<<p->grade3<<"综合测评名次"<<p->ranking2<<endl;break;}p=p->next;}system("pause");system("cls");}
//-----------------学生信息管理界面-------------
void Fire()
{class Student A;while(choose!=0){ cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t\t*           学生信息管理            *"<<endl;cout<<"\t\t\t*                                   *"<<endl; cout<<"\t\t\t*          1.录入学生信息           *"<<endl; cout<<"\t\t\t*          2.删除学生信息           *"<<endl; cout<<"\t\t\t*          3.添加学生信息           *"<<endl; cout<<"\t\t\t*          4.修改学生信息           *"<<endl;cout<<"\t\t\t*          5.保存学生信息           *"<<endl;  cout<<"\t\t\t*          6.显示学生信息           *"<<endl;cout<<"\t\t\t*          0.返回                   *"<<endl;cout<<"\t\t\t*                                   *"<<endl; cout<<"\t\t\t*          按Enter继续              *"<<endl; cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t        请输入0-5之间的任意一数字:"<<' ';cin>>choose;switch(choose)                                     {case 1:system("cls");A.info_input(head);break;case 2:system("cls");A.info_del(head);break;case 3:system("cls");A.info_charu(head);break;case 4:system("cls");A.info_xiugai(head);break;case 5:system("cls");A.info_save(head);break; case 6:system("cls");A.info_show(head);break;default:cout<<"\t\t        输入错误或返回主界面"<<'\n';system("cls");break;}}
}
//-------------学生成绩统计管理界面-----------
void statistics()
{class data B;while(choose!=0){ cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t\t*          学生成绩统计管理         *"<<endl;cout<<"\t\t\t*                                   *"<<endl; cout<<"\t\t\t*          1.添加学生数据           *"<<endl; cout<<"\t\t\t*          2.学生数据查询           *"<<endl; cout<<"\t\t\t*          0.返回                   *"<<endl;cout<<"\t\t\t*                                   *"<<endl; cout<<"\t\t\t*          按Enter继续              *"<<endl; cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t\t*************************************"<<endl;cout<<"\t\t          请输入0-2之间的任意一数字:"<<' ';cin>>choose;switch(choose)                                            {case 1:system("cls");B.data_input(h);break;case 2:system("cls");B.data_chaxun(h);break;default:cout<<"\t\t        输入错误或返回主界面"<<'\n';break;}}
}
//-------------学生查询管理界面-------------
void inquiry()
{char filename[20];cout<<"从文件中读取信息!"<<endl;cout<<"请输入文件名:"<<endl;cin>>filename;ifstream infile;infile.open(filename,ios::in|ios::out);if(!infile){cerr<<"open error!"<<endl;exit(1);}string line;while (getline(cin, line,'\0'))cout <<line<< endl;system("pause");
}
//-----------------关于系统界面---------------
void about()
{while(choose!=0)
{       cout<<"\t\t******************************************************"<<endl;cout<<"\t\t                     关于系统                         "<<endl;cout<<"                                                        "<<endl; cout<<"\t\t系统设计者: 姓名     班级           学号             "<<endl;cout<<"                                                         "<<endl;cout<<"                                                         "<<endl;cout<<"\t\t系统设计日期:  2020.1.11至2020.1.13                  "<<endl;cout<<"                                                         "<<endl;cout<<"\t\t         系统仍有许多不足之处,敬请见谅               "<<endl; cout<<"                                                         "<<endl;cout<<"                                                         "<<endl;cout<<"\t\t                    按0返回:                          "<<endl;cout<<"\t\t******************************************************"<<endl;cin>>choose;switch(choose){case 0:break;default:break;}}
}//-----------------退出程序界面---------------
void thanks()
{     cout<<"                                                          "<<endl;cout<<"                                                          "<<endl;cout<<"                                                          "<<endl; cout<<"\t* * * *  *    *      *      **    *   *    *    * * *   "<<endl; cout<<"\t   *     *    *     * *     * *   *   *   *    *     *  "<<endl;cout<<"\t   *     * ** *    * * *    *  *  *   *  *        *     "<<endl;   cout<<"\t   *     *    *   *     *   *   * *   *   *    *     *  "<<endl;cout<<"\t   *     *    *  *       *  *    **   *    *    * * *   "<<endl;cout<<"\t                                                        "<<endl; cout<<"                                                          "<<endl;cout<<"                                                          "<<endl;
}
//-----------------学生综合测评系统主界面----------
int main()
{while(choose!='0'){cout<<"\t\t  *********************************************** "<<endl;cout<<"\t\t ************************************************* "<<endl;cout<<"\t\t**********                               **********"<<endl; cout<<"\t\t**********           欢迎使用            **********"<<endl; cout<<"\t\t**********                               **********"<<endl;cout<<"\t\t**********         南阳理工学院          **********"<<endl;   cout<<"\t\t**********                               **********"<<endl;cout<<"\t\t**********       学生综合测评系统        **********"<<endl;cout<<"\t\t**********                               **********"<<endl; cout<<"\t\t***************************************************"<<endl;cout<<"\t\t***************************************************"<<endl;cout<<"\t\t*                   操作菜单                      *"<<endl;cout<<"\t\t*                                                 *"<<endl; cout<<"\t\t*                1.学生信息管理                   *"<<endl;cout<<"\t\t*                2.学生成绩统计管理               *"<<endl;   cout<<"\t\t*                3.学生综合数据输出                   *"<<endl;cout<<"\t\t*                4.关于系统                       *"<<endl;cout<<"\t\t*                0.退出系统                       *"<<endl;cout<<"\t\t*                                                 *"<<endl; cout<<"\t\t*                  按Enter继续                    *"<<endl;cout<<"\t\t*                                                 *"<<endl; cout<<"\t\t***************************************************"<<endl;cout<<"\t\t***************************************************"<<endl;   cout<<"\t\t             请输入0-4之间的任意一数字:"<<' ';cin>>choose;switch(choose){case 1:system("cls"); Fire();break;case 2:system("cls"); statistics();break;case 3:system("cls"); inquiry();break;case 4:system("cls"); about();break;case 0:system("cls"); thanks();exit(0);break;default:cout<<"\t\t\t        输入错误,返回"<<endl;break;}}return 0;
}

大学生综合测评系统(C++)相关推荐

  1. MySQL学生综合测评系统_大学生综合测评系统的设计和实现(MySQL)

    大学生综合测评系统的设计和实现(MySQL)(任务书,开题报告,中期检查表,毕业论文20000字,程序代码,数据库) 摘  要 本文详细介绍了本系统设计的基本方法.系统的需求分析.系统的架构设计和系统 ...

  2. 本系统采用jsp和mysql_大学生综合测评系统的设计和实现(MySQL)

    大学生综合测评系统的设计和实现(MySQL)(任务书,开题报告,中期检查表,毕业论文20000字,程序代码,数据库) 摘  要 本文详细介绍了本系统设计的基本方法.系统的需求分析.系统的架构设计和系统 ...

  3. java/php/net/pythonMES大学生综合测评系统的设计与实现设计

    本系统带文档lw万字以上+答辩PPT+查重 如果这个题目不合适,可以去我上传的资源里面找题目,找不到的话,评论留下题目,或者站内私信我, 有时间看到机会给您发 系统体系结构 大学生综合测评系统的结构图 ...

  4. 基于大数据分析的学生综合测评系统

    1.1 研究背景 在大数据时代背景下,需要处理的各种数据或信息量非常大,必须要借助于相关的技术和手段来对大量的数据实施整合和管理,同时各项活动的开展和各种决策的制定往往离不开大数据的分析,因此大数据分 ...

  5. 大学生综合评测系统(C语言)

    大学生综合评测系统(C语言) #include <stdio.h> #include <stdlib.h> typedef struct student{ //定义学生信息结构 ...

  6. 使用Javaweb开发大学生综合素质测评系统

    作者主页:编程指南针 简介:Java领域优质创作者.CSDN博客专家  Java项目.简历模板.学习资料.面试题库.技术互助 文末获取源码 项目编号:BS-GX-004 本项目基于JSP/SERVLE ...

  7. JSP实现大学生综合素质测评系统

    本项目基于JSP/SERVLET技术开发实现,数据库使用MYSQL,开发工具采用IDEA/ECLIPSE. 大学生综合素质测评系统:包含用户管理,学生管理,院系管理,课程管理,各种测评成 管理等,数据 ...

  8. (附源码)Springboot大学生综合素质测评系统 毕业设计 162308

    摘 要 本论文主要论述了如何使用java语言开发一个Springboot大学生综合素质测评系统,本系统将严格按照软件开发流程进行各个阶段的工作,采用B/S架构,面向对象编程思想进行项目开发.本文将论述 ...

  9. (附源码)spring boot大学生综合素质测评系统 毕业设计162308

    Springboot大学生综合素质测评系统 摘要 本论文主要论述了如何使用java语言开发一个Springboot大学生综合素质测评系统,本系统将严格按照软件开发流程进行各个阶段的工作,采用B/S架构 ...

最新文章

  1. html文件修改后缀为aspx之后在ie6中格式显示不正确问题的解决办法
  2. 百度地图相关问题总结
  3. samba 实现linux 共享,用Samba实现Linux之间的文件共享机制
  4. spring框架mvc框架_Spring的MVC测试框架入门–第1部分
  5. leetcode336. 回文对(字典树)
  6. python根据文件路径获取上级目录路径
  7. 【Makefile由浅入深完全学习记录5】预定义变量的使用
  8. 母函数 入门 + 模板
  9. Hadoop: The Definitive Guide (3rd Edition)
  10. Python网络爬虫系列(一)
  11. 9、MySQL逻辑架构介绍
  12. 宝塔控制面板配置Nginx 安全证书
  13. iOS-Senior19-FMDB第三方应用
  14. wordpress 增加备案号
  15. json序列化 java对象_Java中将JSON反序列化为泛型对象
  16. 康佳电视手机遥控器android版,康佳电视遥控器
  17. 还记得最初的九九乘法表吗?
  18. Java数组以及冒泡排序--------07
  19. 实验物理与工业控制系统---EPICS
  20. 弘辽科技:店铺前期可以不上宝贝吗?店铺如何上宝贝?

热门文章

  1. ASP.NET 实现flv流媒体播放
  2. 7、【STM32】独立看门狗和窗口看门狗(IWDG、WWDG)实验
  3. 如何为Mac找到最合适的下载器
  4. day04爬取豌豆荚
  5. C练题笔记之:Leetcode-200. 岛屿数量
  6. NodeJS的模块机制
  7. 【云计算】CentOS7 上配置Openstack(单机)bug记录
  8. 如何让标书脱颖而出?
  9. vue中v-for使用key
  10. 基于PyQt5实现界面控件自适应大小