1、C+ 课程设计 学生成绩管理 1 C+C+课程设计课程设计作业作业 题目:学 生 成 绩 管 理 班级:xxxx 学号:xxxxxx 姓名:xxx C+ 课程设计 学生成绩管理 2 设计题目:学生成绩管理 设计内容:完成学生信息(学号,姓名,性别,年龄,高数成绩,英语成绩,C+程序设计 成绩)的初始化、统计及结果输出。 初始化:从键盘输入基本信息,或者从磁盘文件中读取。 查询及统计信息如下: 按学号查询某学生信息,并将结果输出显示。 统计平均分不及格的学生,并输出其学号、姓名、平均成绩。 按平均分由高到低排序输出学生的所有信息(但不能破坏原有的存储信息) 。 在完成排序输出的同时,在“平均成绩
2、”后面列出每个同学的名次,若分数相同,则名次 相同(选做) 。 存储:将排序结果存储到磁盘文件中去, 系统大致流程图如下 实现代码: #include #include #include class Student /学生类 protected: 4 C+ 课程设计 学生成绩管理 3 int no; /学号 int age,sex; /性别,年龄 char name10; /姓名 float math,cpp,en; /数学成绩、C+成绩 static int count; /累计总人数 Student* next; float aver; int l; public: Student( )
3、Student(int,char*,int,int,float,float,float,Student* =NULL); void show1( ) const /输出每位学生的基本信息 coutcpp=cpp; this-next=next; this-age=age;this-sex=sex;this-en=en; count+; class StuList Student*head; public: StuList( ) head=NULL; StuList( ); void create( ); /创建链表 void print( ) const; /输出链表 void find();
4、 /根据学号查询 C+ 课程设计 学生成绩管理 4 void nopass(); /输出不不及格 void paixu(); void save(); ; StuList:StuList( ) Student*p; while(head) p=head; head=head-next; delete p; void StuList:create( ) /尾结点插入法创建单向链表 Student*p1,*p2; int no,age,sex; char name10; float math,cpp,en; coutnameagesexmathcppen; p1=new Student(no,name,age,sex,math,cpp,en); if(!head) head=p1,p2=p1;else p2-next=p1,p2=p1; coutnext; void St