C++学生成绩管理系统

来源:百度知道 编辑:UC知道 时间:2024/06/01 07:45:33
编写学生成绩管理系统:
1、 有5个学生,每个学生有2门课成绩,从键盘上输入以上数据(学生信息包括学号、姓名,以及2门课成绩),保存在一个文本文件中。
2、 计算出每个学生的总成绩,并将学生数据(包括学生2门课的总成绩)按总分由高到低排序后保存到磁盘文件sort.txt中。
3、 统计平均成绩,不及格比例,及格比例、优良中所占比例。
4、 要求用菜单方式选择功能
程序功能应包括:
1.输入数据
2.计算算总分\平均成绩
3.排序
4.保存文件sort.txt
5.计算比例

5的分项包括:
(1)不及格比例(lesson1、lesson2)
(2)及格比例(lesson1、lesson2)
(3)优良中所占比例(lesson1、lesson2)。

要求用C++编写,C就免了,简明清晰,写明必要的注释,看情况追加悬赏。
十分感谢。

#i nclude<iostream.h>
#i nclude<stdlib.h>
struct student
{
int num;
char name[20];
int foxscore;
int cscore;
int englishscore;
struct student *next;
};

void menu()
{
cout<<" welecome to my student grade management system"<<endl;
cout<<" please follow everyone step in the menu"<<endl;
cout<<" 1.input information"<<endl;
cout<<" 2.total scores"<<endl;
cout<<" 3.sort"<<endl;
cout<<" 4.query"<<endl;
cout<<" ***************************************************"<<endl;
}

struct student *creat(struct student *head) // 函数返回的是与节点相同类型的指针
{
struct student *p1,*p2;
p1=p2=(struct student*) malloc(sizeof(struct student)); // 申请新节点
cin>>p1->num>>p1->name>&