| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4601 人关注过本帖
标题:学生成绩管理系统C++语言
只看楼主 加入收藏
lyb661
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:47
专家分:83
注 册:2018-12-12
结帖率:71.43%
收藏
已结贴  问题点数:20 回复次数:4 
学生成绩管理系统C++语言
学生成绩管理系统
广东海洋大学 本科生课程设计
 说明:本《学生成绩管理系统》程序是一个具有对学生信息进行录入、添加、删除、根据学号进行学生

信息的查询、显示已有学生信息的显示、对学生成绩进行统计(包括最高分,最低分,及格率和需要补

考的学生),可以对已有的学生信息进行修改,保存和读取输入的数据等功能。一切功能都可以在运行

的软件中运行。


附件:(程序代码)
#include<iostream>  
#include<fstream>  //输入输出文件
#include<string>   
#include<iomanip>  //输出格式控制
using namespace std;  
char press;int choose;int n;
class Student
{public:
    int num;
    string name;
    int bj;
    char sex;
    float Math;
    float English;
    float Cjj;
    float sum;
    float average;
};
Student stud[100];
//————————————————读取资料——————————————————
 void read()                       
{char filename[20];
 cout<<"从文件中读取信息!"<<endl;
 cout<<"请输入文件名:"<<endl;
 cin>>filename;
 ifstream infile(filename,ios::in|ios::out);  //定义输入文件流对象,以输出方式打开用户自

定义的磁盘文件
 if(!infile)
  {cerr<<"open error!"<<endl; exit(1); }//输出出错信息
do {int i=0;
  infile>>stud[i].num>>stud[i].name>>stud[i].sex>>stud[i].bj;       //从磁盘读取学生的信


  infile>>stud[i].Math>>stud[i].English>>stud[i].Cjj;   
  cout<<"学生的学号:"<<stud[i].num<<" "                    //向显示器输出学生的信息
<<"姓名:"<<stud[i].name<<" "
 <<"性别:"<<stud[i].sex<<" "
 <<"班级:"<<stud[i].bj<<" "
 <<"高数成绩:"<<stud[i].Math<<" "
<<"大学英语成绩:"<<stud[i].English<<" "
<<"C++成绩:"<<stud[i].Cjj<<endl; i++;}
while(!infile.eof());                                            //判断是否为文件尾
 infile.close();
cout<<"读取成功!"<<endl;}
//————————————————保存资料——————————————————void save()   

                     
{int i;
char filename[20];
for(i=0;i<n;i++)
 {cout<<"学生的学号:"<<stud[i].num<<" "
 <<"姓名:"<<stud[i].name<<" "
 <<"性别:"<<stud[i].sex<<" "
 <<"班级:"<<stud[i].bj<<" "
 <<"高数成绩:"<<stud[i].Math<<" "
 <<"大学英语成绩:"<<stud[i].English<<" "
 <<"C++成绩:"<<stud[i].Cjj<<endl;}
cout<<"将记录保存在文件夹!"<<endl;
cout<<"请输入文件名:";
cin>>filename;
 ofstream outfile(filename);
 if(!outfile){cerr<<"open error!"<<endl;}
 for(i=0;i<n;i++)
 {outfile<<" "<<stud[i].num<<" "<<stud[i].name<<" "<<stud[i].sex<<" "<<stud[i].bj<<" ";
 outfile<<stud[i].Math<<" "<<stud[i].English<<" "<<stud[i].Cjj; }
 outfile.close();cout<<"保存成功!"<<endl;}
//————————————————输入资料——————————————————
void SR()                              
{cout<<"请根据你的需要输入学生的个数:";
cin>>n;for(int a=0;a<n;a++)
{cout<<"请输入第"<<a+1<<"个学生资料:"<<endl;
cout<<"学号:"<<' ';cin>>stud[a].num;
cout<<"姓名:"<<' ';cin>>stud[a].name;
cout<<"性别:"<<' ';cin>>stud[a].sex;
cout<<"班级:"<<' ';cin>>stud[a].bj;
cout<<"高数成绩:"<<' ';cin>>stud[a].Math;
cout<<"大学英语成绩:"<<' ';cin>>stud[a].English;
cout<<"C++成绩:"<<' ';cin>>stud[a].Cjj;
stud[a].sum=stud[a].Math+stud[a].English+stud[a].Cjj;
stud[a].average=(stud[a].Math+stud[a].English+stud[a].Cjj)/3;}
cout<<"输入成功,学生资料是否保存?(y/n)"<<endl;cin>>press;
switch(press)
{case 'y' : save();break;default: cout<<"不保存!";break;}}
//————————————————删除资料——————————————————
void SC()                                
{do{string SC_name;
cout<<"请输入你要删除的学生名字:"<<endl;int i=0;cin>>SC_name;
while(stud[i].name!=SC_name&&i<n) i++;                            //查找判断
if(stud[i].name==SC_name)
{for(int j=i;j<n-1;j++)
{stud[i].num=stud[i+1].num;
 stud[i].name=stud[i+1].name;
 stud[i].sex=stud[i+1].sex;
 stud[i].bj=stud[i+1].bj;
 stud[i].Math=stud[i+1].Math;
 stud[i].English=stud[i+1].English;
 stud[i].Cjj=stud[i+1].Cjj;}
cout<<"删除成功!"<<endl;n=n-1;}
else if(i==n) {cout<<"can't find this name"<<endl;cout<<"该信息不存在,无法删

除!"<<endl;}      
cout<<"(是否继续操作?(y/n))"<<endl;cin>>press;}while(press=='y'||press=='Y') ;}
//————————————————添加资料——————————————————
void TJ()                                 
{do{cout<<"请添加新的学生信息"<<endl;
cout<<"新的学生学号:"<<endl;cin>>stud[n].num;
cout<<"新学生姓名:"<<endl;cin>>stud[n].name;
cout<<"新学生性别:"<<endl;cin>>stud[n].sex;
cout<<"新学生班级:"<<endl;cin>>stud[n].bj;
cout<<"新学生的高数成绩:"<<endl;cin>>stud[n].Math;
cout<<"新学生的大学英语成绩:"<<endl;cin>>stud[n].English;
cout<<"新学生的C++成绩:"<<endl;cin>>stud[n].Cjj;
stud[n].sum=stud[n].Math+stud[n].English+stud[n].Cjj;
stud[n].average=(stud[n].Math+stud[n].English+stud[n].Cjj)/3;n++;                       

            
cout<<"(是否继续操作?(y/n))"<<endl;cin>>press;}
while(press=='y'||press=='Y');
cout<<"添加成功,学生资料是否保存?(y/n)"<<endl;cin>>press;
switch(press)
{case 'y' : save();break;default: cout<<"不保存!";break;}}
//————————————————修改资料——————————————————
void XG()                           
{begin:string find_name;int i;
cout<<"请输入你要修改的学生名字:"<<endl;cin>>find_name;
for(i=0;i<n;i++)
if(stud[i].name==find_name)
{cout<<stud[i].name<<" "<<"has been found:"<<endl;
 cout<<"学生的学号:"<<stud[i].num<<' '
      <<"姓名:"<<stud[i].name<<' '
      << "性别:"<<stud[i].sex<<' '
      << "班级:"<<stud[i].bj<<' '
      <<"高数成绩:"<<stud[i].Math<<' '
      <<"大学英语成绩:"<<stud[i].English<<' '
      <<"C++成绩:"<<stud[i].Cjj<<endl;break;}
 if(stud[i].name!=find_name)
{cout<<"can't find this name"<<endl;
 cout<<"请重新查找!"<<endl;goto begin;}
for(int j=0;j<n;j++)
{cout<<"请输入新的信息:"<<endl;
cout<<"学号:"<<' ';cin>>stud[j].num;
cout<<"姓名:"<<' ';cin>>stud[j].name;
cout<<"性别:"<<' ';cin>>stud[j].sex;
cout<<"班级:"<<' ';cin>>stud[j].bj;
cout<<"高数成绩:"<<' ';cin>>stud[j].Math;
cout<<"大学英语成绩:"<<' ';cin>>stud[j].English;
cout<<"C++成绩:"<<' ';cin>>stud[j].Cjj;   
 stud[i].num=stud[j].num;stud[i].name=stud[j].name;stud[i].sex=stud[j].sex;
 stud[i].bj=stud[j].bj;stud[i].Math=stud[j].Math;stud[i].English=stud[j].English;
 stud[i].Cjj=stud[j].Cjj;break;}
cout<<"修改成功,是否保存?(y/n)"<<endl;
cin>>press;switch(press){case 'y' : save();break;default: cout<<"不保存!";break;}}
//————————————————按总分排名—————————————————
void zf()                           
{int m,t;string na;float z,h,e,c,p;char s;
for(int j=0;j<n-1;j++)                                       //选择法排序
for(int i=0;i<n-1-j;i++)              //以下的按各单科成绩和平均分也是运用选择法排序
if(stud[i].sum>stud[i+1].sum)
      {m=stud[i].num;    stud[i].num=stud[i+1].num;    stud[i+1].num=m;
       na=stud[i].name;  stud[i].name=stud[i+1].name;  stud[i+1].name=na;
       s=stud[i].sex;    stud[i].sex=stud[i+1].sex;    stud[i+1].sex=s;
       t=stud[i].bj;     stud[i].bj=stud[i+1].bj;      stud[i+1].bj=t;
       h=stud[i].Math;   stud[i].Math=stud[i+1].Math;    stud[i+1].Math=h;
       e=stud[i].English;  stud[i].English=stud[i+1].English;    stud[i+1].English=e;
       c=stud[i].Cjj;    stud[i].Cjj=stud[i+1].Cjj;      stud[i+1].Cjj=c;
       z=stud[i].sum;    stud[i].sum=stud[i+1].sum;    stud[i+1].sum=z;
       p=stud[i].average;  stud[i].average=stud[i+1].average;  stud[i+1].average=p;}
cout<<"学生按总分排名:"<<endl;
cout<<"学号"<<' '<<"姓名"<<' '<<"性别"<<' '<<"班级"<<' '<<"总分"<<endl;
for(int i=0;i<n;i++)
{cout<<stud[i].num<<"    "
    <<stud[i].name<<"    "
    <<stud[i].sex<<"    "
    <<stud[i].bj<<"    "
    <<stud[i].sum<<endl;cout<<endl;}}
//—————————————————按高数分数排名——————————————
void gs()                                                         
{int g,t;float z,h,e,c,p;string na;char s;
for(int j=0;j<n-1;j++)                                                         
for(int i=0;i<n-1-j;i++)
   if(stud[i].Math>stud[i+1].Math)
      {g=stud[i].num;    stud[i].num=stud[i+1].num;      stud[i+1].num=g;
       na=stud[i].name;  stud[i].name=stud[i+1].name;    stud[i+1].name=na;
       s=stud[i].sex;    stud[i].sex=stud[i+1].sex;      stud[i+1].sex=s;
       t=stud[i].bj;     stud[i].bj=stud[i+1].bj;        stud[i+1].bj=t;
       h=stud[i].Math;   stud[i].Math=stud[i+1].Math;    stud[i+1].Math=h;
       e=stud[i].English;  stud[i].English=stud[i+1].English;    stud[i+1].English=e;
       c=stud[i].Cjj;    stud[i].Cjj=stud[i+1].Cjj;      stud[i+1].Cjj=c;
       z=stud[i].sum;    stud[i].sum=stud[i+1].sum;    stud[i+1].sum=z;
       p=stud[i].average;  stud[i].average=stud[i+1].average;  stud[i+1].average=p; }
cout<<"学生按高数分数排名:"<<endl;
cout<<"学号"<<' '<<"姓名"<<' '<<"性别"<<' '<<"班级"<<' '<<"高数分数"<<endl;
for(int i=0;i<n;i++)
{cout<<stud[i].num<<"    "
    <<stud[i].name<<"    "
    <<stud[i].sex<<"    "
    <<stud[i].bj<<"    "
    <<stud[i].Math<<endl;cout<<endl;} }
//—————————————————按英语分数排名——————————————
void yy()
{int g,t;float z,h,e,c,p;string na;char s;
for(int j=0;j<n-1;j++)                                                         
for(int i=0;i<n-1-j;i++)
   if(stud[i].English>stud[i+1].English)
      {g=stud[i].num;      stud[i].num=stud[i+1].num;            stud[i+1].num=g;
       na=stud[i].name;    stud[i].name=stud[i+1].name;          stud[i+1].name=na;
       s=stud[i].sex;       stud[i].sex=stud[i+1].sex;             stud[i+1].sex=s;
       t=stud[i].bj;        stud[i].bj=stud[i+1].bj;                stud[i+1].bj=t;
       h=stud[i].Math;     stud[i].Math=stud[i+1].Math;          stud[i+1].Math=h;
       e=stud[i].English;   stud[i].English=stud[i+1].English;       stud

[i+1].English=e;
       c=stud[i].Cjj;       stud[i].Cjj=stud[i+1].Cjj;              stud[i+1].Cjj=c;
       z=stud[i].sum;      stud[i].sum=stud[i+1].sum;            stud[i+1].sum=z;
       p=stud[i].average;   stud[i].average=stud[i+1].average;      stud

[i+1].average=p;}
cout<<"学生按英语分数排名:"<<endl;
cout<<"学号"<<' '<<"姓名"<<' '<<"性别"<<' '<<"班级"<<' '<<"英语分数"<<endl;
for(int i=0;i<n;i++)
{cout<<stud[i].num<<"    "
    <<stud[i].name<<"    "
    <<stud[i].sex<<"    "
    <<stud[i].bj<<"    "
    <<stud[i].English<<endl;cout<<endl;} }
//—————————————————按C++分数排名———————————————
void cy()
{int g,t;float z,h,e,c,p;string na;char s;
for(int j=0;j<n-1;j++)                                                      
for(int i=0;i<n-1-j;i++)
   if(stud[i].Cjj>stud[i+1].Cjj)
      {g=stud[i].num;     stud[i].num=stud[i+1].num;        stud[i+1].num=g;
       na=stud[i].name;   stud[i].name=stud[i+1].name;       stud[i+1].name=na;
       s=stud[i].sex;      stud[i].sex=stud[i+1].sex;          stud[i+1].sex=s;
       t=stud[i].bj;       stud[i].bj=stud[i+1].bj;             stud[i+1].bj=t;
       h=stud[i].Math;    stud[i].Math=stud[i+1].Math;        stud[i+1].Math=h;
       e=stud[i].English;  stud[i].English=stud[i+1].English;    stud[i+1].English=e;
       c=stud[i].Cjj;      stud[i].Cjj=stud[i+1].Cjj;           stud[i+1].Cjj=c;
       z=stud[i].sum;     stud[i].sum=stud[i+1].sum;         stud[i+1].sum=z;
       p=stud[i].average;  stud[i].average=stud[i+1].average;   stud[i+1].average=p;}
cout<<"学生按C++分数排名:"<<endl;
cout<<"学号"<<' '<<"姓名"<<' '<<"性别"<<' '<<"班级"<<' '<<"C++分数"<<endl;
for(int i=0;i<n;i++)
{cout<<stud[i].num<<"    "
    <<stud[i].name<<"    "
    <<stud[i].sex<<"    "
    <<stud[i].bj<<"    "
    <<stud[i].Cjj<<endl;cout<<endl;}}
//————————————————计算最高总分————————————————
void max_student()                     
{float max;
max=stud[0].sum;
for(int j=0;j<n;j++)
{if(stud[j].sum>max)
max=stud[j].sum;}
cout<<"最高总分为:"<<max<<endl;}
//————————————————计算最低总分————————————————
void min_student()                    
{float min;
min=stud[0].sum;
for(int j=0;j<n;j++)
{if(stud[j].sum<min)
min=stud[j].sum;}
cout<<"最低总分为:"<<min<<endl;}
//————————————————按平均分排名————————————————
void aver()                           
{float  z,h,e,c,p;int m,b;string na;char s;
for(int j=0;j<n-1;j++)                                                               
for(int i=0;i<n-1-j;i++)
   if(stud[i].average>stud[i+1].average)
      {m=stud[i].num;      stud[i].num=stud[i+1].num;          stud[i+1].num=m;
       na=stud[i].name;     stud[i].name=stud[i+1].name;        stud[i+1].name=na;
       s=stud[i].sex;        stud[i].sex=stud[i+1].sex;          stud[i+1].sex=s;
       b=stud[i].bj;         stud[i].bj=stud[i+1].bj;            stud[i+1].bj=b;
       h=stud[i].Math;      stud[i].Math=stud[i+1].Math;       stud[i+1].Math=h;
       e=stud[i].English;     stud[i].English=stud[i+1].English;   stud[i+1].English=e;
       c=stud[i].Cjj;        stud[i].Cjj=stud[i+1].Cjj;           stud[i+1].Cjj=c;
       z=stud[i].sum;       stud[i].sum=stud[i+1].sum;          stud[i+1].sum=z;
       p=stud[i].average;   stud[i].average=stud[i+1].average;     stud

[i+1].average=p;}
cout<<"学生按平均分排名:"<<endl;
cout<<"学号"<<' '<<"姓名"<<' '<<"性别"<<' '<<"班级"<<' '<<"平均分"<<endl;
for(int k=0;k<n;k++)
cout<<stud[k].num<<"    "<<stud[k].name<<"    "<<stud[k].sex<<"    "<<stud[k].bj<<"   

"<<stud[k].average<<endl;cout<<endl;}
//————————————————计算及格率—————————————————
void jgl()                          
{int count1=0;int count2=0;int count3=0;float a,b,c;
for(int i=0;i<n;i++)
{if(stud[i].Math>=60)
 count1++;a=((float)count1/(float)n)*100;}
for(int j=0;j<n;j++)
{if(stud[j].English>=60)
 count2++;b=((float)count2/(float)n)*100;}
for(int k=0;k<n;k++)
{if(stud[k].Cjj>=60)
 count3++;c=((float)count3/(float)n)*100;}
cout<<setiosflags(ios::fixed)<<"三科成绩的及格率分别为:"<<endl;
cout<<setprecision(2)<<a<<"%,"
    <<setprecision(2)<<b<<"%,"
    <<setprecision(2)<<c<<"%"<<endl;}
//—————————————————按学生学号查找资料————————————
void sn()                             
{do{int find_num;
cout<<"请输入你要查询的学号:"<<' ';
cin>>find_num;int i;
for(i=0;i<n;i++)
if(stud[i].num==find_num)                                                         
{cout<<"学号为"<<stud[i].num<<"的学生的资料已找到:"<<endl;
 cout<<"学号:"<<stud[i].num<<' '
        <<"姓名:"<<stud[i].name<<' '
        << "性别:"<<stud[i].sex<<' '
        << "班级:"<<stud[i].bj<<' '
        <<"高数成绩:"<<stud[i].Math<<' '
        <<"大学英语成绩:"<<stud[i].English<<' '
        <<"C++成绩:"<<stud[i].Cjj<<endl;break;}
if(stud[i].num!=find_num)
cout<<"can't find this num"<<endl;
cout<<"(是否继续操作?(y/n))"<<endl;cin>>press;}while(press=='y'||press=='Y') ;}
//—————————————————按学生姓名查找资料————————————
void sm()                             
{do{string find_name;
cout<<"请输入你要查询的姓名:"<<' ';
cin>>find_name;int i;
for(i=0;i<n;i++)
if(stud[i].name==find_name)                                                     //

{cout<<"姓名为"<<stud[i].name<<"的学生的资料已找到"<<endl;
 cout<<"学号:"<<stud[i].num<<' '
        <<"姓名:"<<stud[i].name<<' '
        <<"性别:"<<stud[i].sex<<' '
        <<"班级:"<<stud[i].bj<<' '
        <<"高数成绩:"<<stud[i].Math<<' '
        <<"大学英语成绩:"<<stud[i].English<<' '
        <<"C++成绩:"<<stud[i].Cjj<<endl;break;}
if(stud[i].name!=find_name)
cout<<"can't find this name"<<endl;
cout<<"(是否继续操作?(y/n))"<<endl;
cin>>press;}while(press=='y'||press=='Y') ;}
//—————————————————按学生所在班级查找资料——————————
void bbj()                              
{do{int find_bj;
cout<<"请输入你要查询的班级:"<<' ';
cin>>find_bj;int i;
for(i=0;i<n;i++)
if(stud[i].bj==find_bj)                                                               
{cout<<"所在班级为"<<stud[i].bj<<"的所有学生资料已找到:"<<endl;
 cout<<"学生的学号:"<<stud[i].num<<' '
        <<"姓名:"<<stud[i].name<<' '
        <<"性别:"<<stud[i].sex<<' '
        <<"班级:"<<stud[i].bj<<' '
        <<"高数成绩:"<<stud[i].Math<<' '
        <<"大学英语成绩:"<<stud[i].English<<' '
        <<"C++成绩:"<<stud[i].Cjj<<endl;break;}
if(stud[i].bj!=find_bj)
cout<<"can't find this bj"<<endl;
cout<<"(是否继续操作?(y/n))"<<endl;
cin>>press;}while(press=='y'||press=='Y') ;}
//—————————————————学生资料管理界面—————————————
void Fire()
{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*          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)                                     //运用switch多分支选择语句
{case 1:SR();break;
 case 2:SC();break;
 case 3:TJ();break;
 case 4:XG();break;
 case 5:read();break;
default:cout<<"\t\t        输入错误或返回主界面"<<'\n';break;}}}
//—————————————————学生成绩统计管理界面———————————
void statistics()
{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.按C++分数排名          *"<<endl;
     cout<<"\t\t\t*          5.最高总分               *"<<endl;
     cout<<"\t\t\t*          6.最低总分               *"<<endl;
     cout<<"\t\t\t*          7.按平均分排名           *"<<endl;
     cout<<"\t\t\t*          8.及格率                 *"<<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-8之间的任意一数字:"<<' ';
     cin>>choose;
switch(choose)                                            
{case 1: zf();break;
 case 2: gs(); break;
 case 3: yy();break;
 case 4: cy();break;
 case 5:max_student ();break;
 case 6:min_student ();break;
 case 7:aver();break;
 case 8:jgl();break;
 default:cout<<"\t\t        输入错误或返回主界面"<<'\n';break;}}}
 //—————————————————学生查询管理界面—————————————
void inquiry()
{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*          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-3之间的任意一数字:"<<' ';cin>>choose;
     switch(choose)
{case 1: sn();break;
 case 2: sm();break;
 case 3: bbj();break;
default:cout<<"\t\t        输入错误或返回主界面"<<'\n';break;}}}
 //—————————————————关于系统界面———————————————
void about()
{while(choose!=0)
{       cout<<"\t\t******************************************************"<<endl;
        cout<<"\t\t                     关于系统                         "<<endl;
        cout<<"                                                        "<<endl;
        cout<<"\t\t系统设计者: 姓名     班级           学号             "<<endl;
        cout<<"                                                         

"<<endl;
        cout<<"\t\t            郑镇鹏  信管1081    2008116221133         "<<endl;
        cout<<"                                                         "<<endl;
        cout<<"\t\t            吴晓阳  信管1081    200811622126          "<<endl;   
        cout<<"                                                         "<<endl;
        cout<<"\t\t系统设计日期:  2009.10.29至2009.11.28                 

"<<endl;
        cout<<"                                                         "<<endl;
        cout<<"\t\t         系统仍有许多不足之处,敬请见谅               

"<<endl;
        cout<<"                                                         "<<endl;
        cout<<"\t\t          如发现错误,请联系QQ110119120               "<<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: Fire();break;
 case 2: statistics();break;
 case 3: inquiry();break;
 case 4: about();break;
 case 0: thanks();exit(0);break;
 default:cout<<"\t\t\t        输入错误,返回"<<endl;break;}}
 return 0;
}
搜索更多相关主题的帖子: 学生 name int num cout 
2019-05-14 14:41
Jonny0201
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:52
帖 子:488
专家分:2603
注 册:2016-11-7
收藏
得分:10 
有些偏向于 C 了
C++ 写管理系统还是比较建议用面向对象的思维
2019-05-14 23:55
tt138
Rank: 2
等 级:论坛游民
威 望:1
帖 子:16
专家分:17
注 册:2019-4-19
收藏
得分:10 
回复 楼主 lyb661
哈哈,看了半天,最后才看到你的主程序,这个不是好主意。
书上说,主程序最好放前面,以便一目了然。
你这个是千呼万唤才出来,最后才知道你要干什么,和c++说什么oop有点不搭。
虽然我还没编一个程序,连课本的程序都还没开始敲,但你这么写感觉有点象做流水账。


[此贴子已经被作者于2019-5-15 21:53编辑过]

2019-05-15 21:34
大头leo
Rank: 2
等 级:论坛游民
帖 子:21
专家分:40
注 册:2019-10-23
收藏
得分:0 
刚刚调试了一下发现这个程序有一些bug
比如输入不了学生成绩之类的
楼主记得修改哦
2019-11-13 21:18
阳光宝宝
Rank: 1
等 级:新手上路
威 望:1
帖 子:12
专家分:0
注 册:2006-6-3
收藏
得分:0 
一个VB6程序爱好者,初学C++,看了这个代码,有点恐怖

http://abc.
2022-04-11 16:58
快速回复:学生成绩管理系统C++语言
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025371 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved