学生成绩管理系统的阅读对象
❶ 学生成绩管理系统用类 请用面向对象方法设计并实现如下功能: l 设置学生的成绩信息:学生学号、姓名、所
Based on your subject 学生成绩管理系来统用类 请用面自向对象方法设计并实现如下功...,
联系我们需要提供你的问题和电子邮件,
还有别的要求么,可以与我们联系,
有时间可以帮你,
网络_Hi联系我,
此回复针对所有来访者和需求者有效,
ES:\\
❷ 学生成绩统计管理系统C++使用类和对象 满意补充100分
#include"stdafx.h"
#include<malloc.h>
#include<iostream>
#include<iomanip>
#include<string>
usingnamespacestd;
#defineN5
classStudent
{
public:
stringname;
floatmath;
floatchinese;
floatenglish;
floatsum;
intrange;
staticfloataveproject[3];
staticintnopass[3];
staticintpretty[3];
Student(){name="";math=0;chinese=0;english=0;sum=0;}
Student(stringn,floatm,floatc,floate):name(n),math(m),chinese(c),english(e)
{
=math+chinese+english;
}
voidsetmessage(stringn,floatm,floatc,floate)
{
name=n;
math=m;
chinese=c;
english=e;
sum=math+chinese+english;
}
};
floatStudent::aveproject[3]={0};
intStudent::nopass[3]={0};
intStudent::pretty[3]={0};
voidtotal(Student*s,intn){
inti;
for(i=0;i<n;i++)
{
s[0].aveproject[0]=s[0].aveproject[0]+s[i].math;
s[0].aveproject[1]=s[0].aveproject[1]+s[i].chinese;
s[0].aveproject[2]=s[0].aveproject[2]+s[i].english;
}
s[0].aveproject[0]/=n;
s[0].aveproject[1]/=n;
s[0].aveproject[2]/=n;
for(i=0;i<n;i++)
{
if(s[i].math<s[0].aveproject[0])s[0].nopass[0]++;elses[0].pretty[0]++;
if(s[i].chinese<s[0].aveproject[1])s[0].nopass[1]++;elses[0].pretty[1]++;
if(s[i].english<s[0].aveproject[2])s[0].nopass[2]++;elses[0].pretty[2]++;
}
}
voidprintrank(Student*s,intn)
{
inti;
for(i=0;i<n;i++)
{
cout<<s[i].name<<setw(5)<<s[i].math<<setw(5)<<s[i].chinese<<setw(5)
<<s[i].english<<setw(5)<<s[i].sum<<endl;
}
}
voidprintave(Student*s)
{
cout<<"数学平均分:"<<Student::aveproject[0]<<endl;
cout<<"语文平均分:"<<Student::aveproject[1]<<endl;
cout<<"英语平均分:"<<Student::aveproject[2]<<endl;
}
voidprintnopass(Student*s)
{
cout<<"数学不及格人数:"<<Student::nopass[0]<<endl;
cout<<"语文不及格人数:"<<Student::nopass[1]<<endl;
cout<<"英语不及格人数:"<<Student::nopass[2]<<endl;
}
voidprintpretty(Student*s)
{
cout<<"数学优秀人数:"<<Student::pretty[0]<<endl;
cout<<"语文优秀人数:"<<Student::pretty[1]<<endl;
cout<<"英语优秀人数:"<<Student::pretty[2]<<endl;
}
intmain()
{
inti,j;
Studentstu[N]={Student("LiLei",100.0,90,87),Student("HanMe",68,90.0,97),Student("Lucy",100.0,87,67)};
stu[4].setmessage("lida",92,96,70);
stu[3].setmessage("lsao",78,76,90);
total(stu,N);
printrank(stu,N);
printave(stu);
printnopass(stu);
printpretty(stu);
return0;
}
❸ 学生成绩管理系统 要求:1,学生基本信息,(学号,姓名,班级) 2,学生选课信息(平时成绩,期末成绩)
用struct定义一个结构体数组,比如
struct student
{ char name[30];
int math;
int chinese;
.....
int total;
int averrage;
int score;
};
struct student stu[N]; 这里有几个学生N就等于几
然后内定义几个count值去记录满足某容个条件的学生个数就行了。
比如算有几个math不及格的学生
int count=0,i;
for(i=0;i<N;i++)
if(stu[i].math<60)
count++;
其他方面就按照类似方法记录
❹ 学生成绩管理系统
wo gang xie le ge yao jia Q
❺ 请用C++面向对象的方法实现一个简单的学生成绩管理系统。
class Stu
{
private:
string name; //string是字符串类,在这里定义了学生姓名的字符串
char num[11]; //定义char,是为调用字符数值转换函数atol准备
float sc_computer;
char major;
public:
Stu();
Stu(stringa,char b[],char c):name(a),sc_computer(c)//构造函数初始化
{ int i=0;
while(b[i]!='\0') { num[i]=b[i]; i++;}
num[i]='\0';}
int Sort_Sc(Stu sc[],intcount); //按照计算机成绩对学生信息排序
int Sub_Major(Stu nm[],int count); //按学好分专业
intShow_Stu(Stu sc[],int count); //显示学生信息
intInit_Stu(Stu sc[],int count); //学生录入
};
/**********************************主程序**********************************/
int main()
{
int cnt=0;
Stu *stu,st;
char choice;
charch1;
cout<<"\t\t****\n\n\t\t\t欢迎进入学生信息管理查询系统\n\n\t\t****\n\n";
cout<<"\t\t\t***************主菜单***************\n\n";
cout<<"\t\t\t\t1>学生信息录入\n\n";
cout<<"\t\t\t\t2>学生信息显示\n\n";
cout<<"\t\t\t\t3>学生信息排序\n\n";
cout<<"\t\t\t\t4>学生专业\n"<<endl;
cout<<"\t\t\t\t0>退出\n";
ch1='y';
do{
cout<<"\n请选择功能选项: ";
cin>>choice;
switch(choice)
{
case'0': {ch1='n';break;}
case'1':{
cout<<"请输入学生的数量: ";
cin>>cnt;
stu=newStu[cnt+1]; //Stu[0]不存学生信息,学生信息从数组下标1开始
st.Init_Stu(stu,cnt);
break;}
case'2':{
cout<<"输出所有学生信息:"<<endl;
st.Show_Stu(stu,cnt);
break;}
case'3':{
st.Sort_Sc(stu,cnt);
st.Show_Stu(stu,cnt);
break;}
case'4':{
st.Sub_Major(stu,cnt);
st.Show_Stu(stu,cnt);
break;}
default:{
cout<<"\a\a警告:您输入错误,是否重输!(y/n)\t";
cin>>ch1;} }
}while(ch1=='y');
❻ 急求 学生成绩管理系统 请用面向对象方法设计并实现如下功能(c++)
// 学生成绩管理系统.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#define N 2
struct StudentType
{
char no[10];
char name[10];
double foreigen;
double spec1;
double spec2;
double total;
};
void InputMarks(struct StudentType student[],int n);
void AddMarks(struct StudentType student[],int n);
void OutputMarks(struct StudentType student[],int n);
int _tmain(int argc, _TCHAR* argv[])
{
struct StudentType stu[N];
InputMarks(stu,N);
AddMarks (stu,N);printf("各个考生的总成绩为:\n");
OutputMarks(stu,N);
return 0;
}
void InputMarks(struct StudentType student[],int n)
{
for (int i = 0; i<n; i++)
{
("请输入第%d个考生考号:",i+1);
scanf("%s",student[i].no);
printf("请输入第%d个考生姓名:",i+1);
scanf("%s",student[i].name);
printf("请输入第%d个考生的外语成绩:",i+1);
scanf("%lf",student[i].foreigen);
printf("请输入第%d个考生专业课程1:",i+1);
scanf("%lf",student[i].spec1);
printf("请输入第%d个考生专业课程2:",i+1);
scanf("%lf",student[i].spec2);
}
return;
}
void AddMarks(struct StudentType student[] , int n)
{
for (int i= 0; i<n ; i++)
{
student[i].total=student[i].foreigen+student[i].spec1+student[i].spec2;
}
return;
}
void OutputMarks(struct StudentType student[],int n)
{
for (int i=0;i<n;i++)
{
printf("%s的总分是5.lf\n",student[i].name,student[i].total);
}
return;
}
我用VS编的,你适当改改就可以用了
❼ 学生成绩管理系统 (模拟实现一个学生成绩管理系统:该系统存储学生学号、姓名、性别、专业班级、C语言课程
能翻译一下吗
❽ 面向对象程序设计编写一个简单的学生成绩管理系统
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#define LEN sizeof(struct scorenode)
#define DEBUG
#include <string.h>
struct scorenode
{int number;/*学号*/
char name[10];/*姓名*/
float computer;/*计算机 成绩*/
float english;/*英语成绩*/
float math;/*数学成绩 */
struct scorenode *next;
};
typedef struct scorenode score;
int n,k;/*n,k为全局变量,本程序中的函数均可以使用它*/
/*==============================================================================================*/
score *creat(void)/*函数creat,功能:创建链表,此函数带回一个指向链表头的指针*/
{
score*head;
score *p1,*p2,*p3,*max;
int i,j;
float fen;
char t[10];
n=0;
p1=p2=p3=(score *)malloc(LEN);head=p3; /*开辟一个新单元输入学生相关资料*/
printf("请输入学生资料,输0退出!\n");
repeat1: printf("请输入学生学号(学号应大于0):");
scanf("%d",&p1->number);
while(p1->number<0)
{getchar();
printf("输入错误,请重新输入学生学号:");
scanf("%d",&p1->number);}
if(p1->number==0)
goto end;
else
{
p3=head;
if(n>0)
{for(i=0;i<n;i++)
{if(p1->number!=p3->number)
p3=p3->next;
else
{printf("学号重复,请重输!\n");
goto repeat1;
}
}
}
}
printf("请输入学生姓名:");
scanf("%s",&p1->name);
printf("请输入计算机 成绩(0~100):");
scanf("%f",&p1->computer);
while(p1->computer<0||p1->computer>100)
{getchar();
printf("输入错误,请重新输入计算机 成绩");
scanf("%f",&p1->computer);}
printf("请输入英语成绩(0~100):");
scanf("%f",&p1->english);
while(p1->english<0||p1->english>100)
{getchar();
printf("输入错误,请重新输入英语成绩");
scanf("%f",&p1->english);}
printf("请输入数学成绩(0~100):");
scanf("%f",&p1->math);
while(p1->math<0||p1->math>100)
{getchar();
printf("输入错误,请重新输入数学成绩");
scanf("%f",&p1->math);}
head=NULL;
while(p1->number!=0)
{
n=n+1;
if(n==1)
head=p1;
else
p2->next=p1;
p2=p1;
p1=(score *)malloc(LEN);
printf("请输入学生资料,输0退出!\n");
repeat2:printf("请输入学生学号(学号应大于0):");
scanf("%d",&p1->number);
while(p1->number<0)
{getchar();
printf("输入错误,请重新输入学生学号:");
scanf("%d",&p1->number);}
if(p1->number==0)
goto end;
else
{
p3=head;
if(n>0)
{for(i=0;i<n;i++)
{if(p1->number!=p3->number)
p3=p3->next;
else
{printf("学号重复,请重输!\n");
goto repeat2;
}
}
}
}
printf("请输入学生姓名:");
scanf("%s",&p1->name);
printf("请输入计算机 成绩(0~100):");
scanf("%f",&p1->computer);
while(p1->computer<0||p1->computer>100)
{getchar();
printf("输入错误,请重新输入计算机 成绩");
scanf("%f",&p1->computer);}
printf("请输入英语成绩(0~100):");
scanf("%f",&p1->english);
while(p1->english<0||p1->english>100)
{getchar();
printf("输入错误,请重新输入英语成绩");
scanf("%f",&p1->english);}
printf("请输入数学成绩(0~100):");
scanf("%f",&p1->math);
while(p1->math<0||p1->math>100)
{getchar();
printf("输入错误,请重新输入数学成绩");
scanf("%f",&p1->math);}
}
end: p1=head;
p3=p1;
for(i=1;i<n;i++)
{
for(j=i+1;j<=n;j++)
{
max=p1;
p1=p1->next;
if(max->number>p1->number)
{
k=max->number;
max->number=p1->number;
p1->number=k;
strcpy(t,max->name);
strcpy(max->name,p1->name);
strcpy(p1->name,t);
fen=max->computer;
max->computer=p1->computer;
p1->computer=fen;
fen=max->english;
max->english=p1->english;
p1->english=fen;
fen=max->math;
max->math=p1->math;
p1->math=fen;
}
}
max=head;p1=head;/*重新使max,p指向链表头*/
}
p2->next=NULL;/*链表结尾*/
printf("输入的学生数为:%d个!\n",n);
return(head);
}
/*==============================================================================================*/
score *add2311(score *head,score *stu)/*函数add2311,功能将所有学生资料按学号排序*/
{
score *p0,*p1,*p2,*p3,*max;
int i,j;
float fen;
char t[10];
p3=stu=(score *)malloc(LEN);/*开辟一个新单元*/
printf("\n输入要增加的学生的资料!");
repeat4: printf("请输入学生学号(学号应大于0):");
scanf("%d",&stu->number);
/*输入学号,学号应大于0*/
while(stu->number<0)
{getchar();
printf("输入错误,请重新输入学生学号:");
scanf("%d",&stu->number);}/*输入错误,重新输入学号*/
if(stu->number==0)
goto end2;/*当输入的学号为0时,转到末尾,结束追加*/
else
{
p3=head;
if(n>0)
{for(i=0;i<n;i++)
{if(stu->number!=p3->number)
p3=p3->next;
else
{printf("学号重复,请重输!\n");
goto repeat4;
}
}
}
}
/******************************************************/
printf("输入学生姓名:");
scanf("%s",stu->name);
printf("请输入计算机 成绩(0~100):");
scanf("%f",&stu->computer);
while(stu->computer<0||stu->computer>100)
{getchar();
printf("输入错误,请重新输入计算机 成绩");
scanf("%f",&stu->computer);}
printf("请输入英语成绩(0~100):");
scanf("%f",&stu->english);
while(stu->english<0||stu->english>100)
{getchar();
printf("输入错误,请重新输入英语成绩");
scanf("%f",&stu->english);}
printf("请输入数学成绩(0~100):");
scanf("%f",&stu->math);
while(stu->math<0||stu->math>100)
{getchar();
printf("输入错误,请重新输入数学成绩");
scanf("%f",&stu->math);}
p1=head;
p0=stu;
if(head==NULL)
{head=p0;p0->next=NULL;}/*当原来链表为空时,从首结点开始存放资料*/
else
{
if(p1->next==NULL)
{
p1->next=p0;
p0->next=NULL;
}
else
{
while(p1->next!=NULL)
{
p2=p1;p1=p1->next;
}
p1->next=p0;
p0->next=NULL;
}
}
n=n+1;
p1=head;
p0=stu;
for(i=1;i<n;i++)
{
for(j=i+1;j<=n;j++)
{
max=p1;
p1=p1->next;
if(max->number>p1->number)
{
k=max->number;
max->number=p1->number;
p1->number=k;
strcpy(t,max->name);
strcpy(max->name,p1->name);
strcpy(p1->name,t);/*交换前后结点中的姓名,使之与学号相匹配*/
fen=max->computer;
max->computer=p1->computer;
p1->computer=fen;
fen=max->english;
max->english=p1->english;
p1->english=fen;
fen=max->math;
max->math=p1->math;
p1->math=fen;
}
}
max=head;p1=head;
} end2:
printf("现在的学生数为:%d个!\n",n);
return(head);
}
score *search(score *head)
/*函数search,功能:查询学生成绩*/
{int number;
score *p1,*p2;
printf("输入要查询的学生的学号,");
scanf("%d",&number);
while(number!=0)
{
if(head==NULL)
{printf("\n没有任何学生资料!\n");return(head);}
printf("-----------------------------------------\n");
printf("|学号\t|姓名\t|计算机\t|英语\t|数学\t|\n");
printf("-----------------------------------------\n");
p1=head;
while(number!=p1->number&&p1->next!=NULL)
{p2=p1;p1=p1->next;}
if(number==p1->number)
{printf("|%d\t|%s\t|%.1f\t|%.1f\t|%.1f\t|\n",p1->number,p1->name,p1->computer,p1->english,p1->math);
printf("-----------------------------------------\n");}
else
printf("%d不存在此学生!\n",number);
printf("输入要查询的学生的学号,");
scanf("%d",&number);
}
printf("已经退出了!\n");
return(head);}
/*==============================================================================================*/
score *del(score *head)/*函数del,功能:删除学生资料*/
{
score *p1,*p2;
int number;
printf("输入要删除的学生的学号(输入0时退出):");
scanf("%d",&number);
getchar();
while(number!=0)/*输入学号为0时退出*/
{
if(head==NULL)
{
printf("\n没有任何学生资料!\n");
return(head);
}
p1=head;
while(number!=p1->number&&p1->next!=NULL)
{
p2=p1;p1=p1->next;
}
if(number==p1->number)
{
if(p1==head)
head=p1->next;
/*若p1指向的是首结点,把地二个结点地址赋予head*/
else
p2->next=p1->next;
printf("删除:%d\n",number);n=n-1;
}
else
printf("%d不存在此学生!\n",number);
printf("输入要删除的学生的学号:");
scanf("%d",&number);
getchar();
}
#ifdef DEBUG
printf("已经退出了!\n");
#endif
printf("现在的学生数为:%d个!\n",n);
return(head);
}
/*==============================================================================================*/
void print(score *head)/*函数print,功能:显示学生成绩*/
{
score *p;
if(head==NULL)
{printf("\n没有任何学生资料!\n");}
else
{printf("%d\n",n);
printf("-----------------------------------------\n");
printf("|学号\t|姓名\t|计算机\t|英语\t|数学\t|\n");
printf("-----------------------------------------\n");
p=head;
do
{printf("|%d\t|%s\t|%.1f\t|%.1f\t|%.1f\t|\n",p->number,p->name,p->computer,p->english,p->math);
printf("-----------------------------------------\n");
p=p->next;}while (p!=NULL);
}
}
/*==============================================================================================*/
score *tongji(score *head)
/*函数tongji,功能:统计学生成绩*/
{
float sum1=0,sum2=0,sum3=0,ave1=0,ave2=0,ave3=0,max=0,min;
score *p;
int x,y=0,i=0;
p=head;
printf("1个人总分和平均分\t2单科平均分\t3总分最高分\t4总分最低分\n");
scanf("%d",&x);
getchar();
switch(x)
{
case 1: if(head==NULL)
{printf("\n没有任何学生资料!\n");return(head);}
else
{
printf("---------------------------------------------------------\n");
printf("|学号\t|姓名\t|计算机\t|英语\t|数学\t|总分\t|平均分\t|\n");
printf("---------------------------------------------------------\n");
while(p!=NULL)
{
sum1=p->computer+p->english+p->math;
ave1=sum1/3;
printf("|%d\t|%s\t|%.1f\t|%.1f\t|%.1f\t|%.1f\t|%.1f\t|\n",p->number,p->name,p->computer,p->english,p->math,sum1,ave1);
printf("---------------------------------------------------------\n");/*打印表格域*/
p=p->next;}
}
return(head); break;
case 2: if(head==NULL)
{printf("\n没有任何学生资料!\n");return(head);}
while(p!=NULL)
{
sum1=sum1+p->computer;
sum2=sum2+p->english;
sum3=sum3+p->math;/*计算总分*/
y=y+1;
ave1=sum1/y;
ave2=sum2/y;
ave3=sum3/y;
p=p->next;
}
printf("计算机 平均分是%.1f\n",ave1);
printf("英语平均分是%.1f\n",ave2);
printf("数学平均分是%.1f\n",ave3);
return(head); break;
case 3:
if(head==NULL)
{printf("\n没有任何学生资料!\n");return(head);}
max=p->computer+p->english+p->math;
while(i<n)
{
i=i+1;
sum1=p->computer+p->english+p->math;
if(max<sum1)
max=sum1;
p=p->next;
}
printf("总分最高分:%.1f",max);
printf("\n");
return(head); break;
case 4: if(head==NULL)
{printf("\n没有任何学生资料!\n");return(head);}
while(p!=NULL)
{
min=p->computer+p->english+p->math;
while(p!=NULL)
{sum2=p->computer+p->english+p->math;
if(min>sum2)
min=sum2;
p=p->next;
}
}
printf("总分最低分:%.1f",min);
printf("\n");
return(head); break;
default :printf("输入错误,请重试!\n");
}
return(head);
}
/*==============================================================================================*/
save(score *p1)
/*函数save,功能:保存学生的资料*/
{
FILE *fp;
char filepn[20];/*用来存放文件保存路径以及文件名*/
printf("请输入文件路径及文件名:");
scanf("%s",filepn);
if((fp=fopen(filepn,"w+"))==NULL)
{
printf("不能打开文件!\n");
return 0;
}
fprintf(fp,"|学号\t|姓名\t|计算机\t|英语\t|数学\t|\n");
fprintf(fp,"-----------------------------------------\n");
while(p1!=NULL)
{
fprintf(fp,"%d\t%s\t%.1f\t%.1f\t%.1f\t\n",p1->number,p1->name,p1->computer,p1->english,p1->math);
p1=p1->next;
}
fclose(fp);
printf("文件已经保存!\n");
return 0;
}
/*==============================================================================================*/
score *paixu(score *head) /*定义排序函数。此函数带回一个指向链表头的指针*/
{ score *p,*max;
int i,j,x;
float fen;
char t[10];
if(head==NULL)
{printf("\n没有任何学生资料,请先建立链表!\n");return(head);}/*链表为空*/
max=p=head;
for(i=0;i<80;i++)
printf("*");
printf("1按学生学号排序\t2按学生姓名排序\t3按计算机 成绩排序\n");
printf("4按英语成绩排序\t5按数学成绩排序\t\n");
for(i=0;i<80;i++)
printf("*");
printf("请选择操作:");
scanf("%d",&x);/*选择操作*/
getchar();
switch(x)
{case 1 :
for(i=1;i<n;i++)
{
for(j=i+1;j<=n;j++)
{
max=p;
p=p->next;
if(max->number>p->number)
{
k=max->number;
max->number=p->number;
p->number=k;
strcpy(t,max->name);
strcpy(max->name,p->name);
strcpy(p->name,t);
fen=max->computer;
max->computer=p->computer;
p->computer=fen;
fen=max->english;
max->english=p->english;
p->english=fen;
fen=max->math;
max->math=p->math;
p->math=fen;
}
}
max=head;p=head;/*重新使max,p指向链表头*/
}
print(head);break;
case 2 : for(i=1;i<n;i++)
{
for(j=i+1;j<=n;j++)
{
max=p;
p=p->next;
if(strcmp(max->name,p->name)>0)/*字符串比较*/
{
strcpy(t,max->name);/*字符串复制*/
strcpy(max->name,p->name);
strcpy(p->name,t);
k=max->number;
max->number=p->number;
p->number=k;
fen=max->computer;
max->computer=p->computer;
p->computer=fen;
fen=max->english;
max->english=p->english;
p->english=fen;
fen=max->math;
max->math=p->math;
p->math=fen;
/*交换前后结点中的数学成绩,使之与姓名相匹配*/
}
}
p=head;
max=head;
}
print(head);
break;
case 3 : for(i=1;i<n;i++)
{for(j=i+1;j<=n;j++)
{max=p;
p=p->next;
if(max->computer>p->computer)
{
fen=max->computer;
max->computer=p->computer;
p->computer=fen;
k=max->number;
max->number=p->number;
p->number=k;
strcpy(t,max->name);
strcpy(max->name,p->name);
strcpy(p->name,t);
fen=max->english;
max->english=p->english;
p->english=fen;
fen=max->math;
max->math=p->math;
p->math=fen;
}
}
p=head;
max=head;
}
print(head);
break;
case 4 : for(i=1;i<n;i++)
{for(j=i+1;j<=n;j++)
{max=p;
p=p->next;
if(max->english>p->english)
{
fen=max->english;
max->english=p->english;
p->english=fen;
k=max->number;
max->number=p->number;
p->number=k;
strcpy(t,max->name);
strcpy(max->name,p->name);
strcpy(p->name,t);
fen=max->computer;
max->computer=p->computer;
p->computer=fen;
fen=max->math;
max->math=p->math;
p->math=fen;
}
}
p=head;
max=head;
}
print(head);
break;
case 5 : for(i=1;i<n;i++)
{for(j=i+1;j<=n;j++)
{max=p;
p=p->next;
if(max->math>p->math)
{
fen=max->math;
max->math=p->math;
p->math=fen;
k=max->number;
max->number=p->number;
p->number=k;
strcpy(t,max->name);
strcpy(max->name,p->name);
strcpy(p->name,t);
fen=max->computer;
max->computer=p->computer;
p->computer=fen;
fen=max->english;
max->english=p->english;
p->english=fen;
}
}
p=head;
max=head;
}
print(head);
break;
default :printf("输入错误,请重试! \n");
}
return (0);}
/*==============================================================================================*/
int menu(k)/*函数menu,功能:菜单选择界面*/
{
int i;
printf("\t\t\t\t学生信息管理系统\n");
for(i=0;i<80;i++)
printf("*");
printf(" \t\t\t1添加学生记录\t\t\t \n");
printf(" \t\t\t2.显示学生记录\t\t\t \n");
printf(" \t\t\t3.删除学生记录\t\t\t \n");
printf(" \t\t\t4.查询学生记录\t\t\t \n");
printf(" \t\t\t5.统计学生记录\t\t\t \n");
printf(" \t\t\t6.排序\t\t\t \n");
printf(" \t\t\t7.保存学生记录\t\t\t \n");
/*菜单选择界面*/
for(i=0;i<80;i++)
printf("*");
printf("请选择您所要的操作(选择(0)退出):");
scanf("%d",&k);/*选择操作*/
getchar();
return (k);}
main()
{score *head=0,*stu=0;
while(1)
{k=menu(k);
switch(k)/*用switch语句实现功能选择*/
{case 1: head=creat();break;/*调用创建链表函数*/
case 2: print(head); break;/*调用显示学生信息函数*/
case 3: head=del(head); break;/*调用删除学生信息函数*/
case 4: head=search(head);break;/*调用成绩查询函数*/
case 5: tongji(head); break;/*调用统计函数*/
case 6: paixu(head);break;/*调用排序函数*/
case 7: save(head);break;/*调用保存函数*/
case 0: exit(0);/*退出系统,返回主界面*/
default: printf("输入错误,请重试!\n"); }
}
自己套了修改!
❾ 要用C++写个学生成绩管理系统,有个类 学生。对象用对象数组保存。
CArray可以办到,
不过你要把你的类设计好,看你不知道CArray的情况下,估计你也设计不好版类。
给你举个例子:
class student
{
public:
operate=(const student &st);
...//属性权
}
student::operate=(const student &st)
{
自己的属性=st的属性
}
CArray<student,student> ca;
student st;
ca.Add(st);
ca.GetSize();
ca.GetAt(i);
ca.RemoveAll();
...
❿ 学生成绩管理系统 内容:
不知道。我是来打酱油的