学生成绩管理系统(c++)(共33页).docx
《学生成绩管理系统(c++)(共33页).docx》由会员分享,可在线阅读,更多相关《学生成绩管理系统(c++)(共33页).docx(33页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上学生成绩管理系统(仅源代码)#include#include#include#include#define MAX_NUM 10/对象数组最大容纳人数 using namespace std;int pupil_num = 0;int mid_stu_num = 0;int univ_stu_num = 0;class Student public:friend class BaseOperate;protected:string no;string name;string sex;int age;int class_infor2;/分别存储年级和班级 int tot
2、al_grade; class Pupil:public Student public:friend class BaseOperate;protected:int english_grade;int math_grade;int chinese_grade; class MiddleSchoolStudent:public Pupil public:friend class BaseOperate;private:int geography_grade;int history_grade; ;class UniversityStudent:public Student public:frie
3、nd class BaseOperate;private:int major_grade;int english_grade;int higher_math_grade;int programming_grade;Pupil pupilMAX_NUM;MiddleSchoolStudent mid_stuMAX_NUM;UniversityStudent univ_stuMAX_NUM;class BaseOperate public:bool query();/查询 bool addRecordInPupil(string no);bool addRecordInMid(string no)
4、;bool addRecordInUniv(string no);bool deleteRecordInPupil(string no);bool deleteRecordInMid(string no); bool deleteRecordInUniv(string no);bool modifyInforInPupil(string no);bool modifyInforInMid(string no);bool modifyInforInUniv(string no);void show();/输出所有学生信息 void tally();/统计 (能统计学生人数、总分、单科的平均分等)
5、void sort();/排序 (可按总分和单科成绩排名次)void save();void read();bool BaseOperate:query() string no; cout 请输入学号: no;cout endl;cout.setf(std:ios:left);/在小学生中查找 for (int i = 0; i pupil_num; i+) if (no = pupili.no) cout 学生类型:小学生 endl endl;cout 学号 姓名 性别 年龄 班级 语文 数学 英语 endl;cout setw(6) pupili.no setw(8) pupili.nam
6、e setw(8) pupili.sex setw(6) pupili.age setw(3) (pupili.class_infor)0 0 setw(3) (pupili.class_infor)1 setw(7) pupili.chinese_grade setw(7) pupili.math_grade setw(7) pupili.english_grade endl endl; return true; for (int i = 0; i mid_stu_num; i+) if (no = mid_stui.no) cout 学生类型:中学生 endl endl;cout 学号 姓
7、名 性别 年龄 班级 语文 数学 英语 地理 历史 endl;cout setw(6) mid_stui.no setw(8) mid_stui.name setw(8) mid_stui.sex setw(6) mid_stui.age setw(3) (mid_stui.class_infor)0 0 setw(3) (mid_stui.class_infor)1 setw(7) mid_stui.chinese_grade setw(7) mid_stui.math_grade setw(7) mid_stui.english_grade setw(7) mid_stui.geograp
8、hy_grade setw(7) mid_stui.history_grade endl endl;return true;for (int i = 0; i univ_stu_num; i+) if (no = univ_stui.no) cout 学生类型:大学生 endl endl;cout 学号 姓名 性别 年龄 班级 专业 高数 英语 编程 endl;cout setw(6) univ_stui.no setw(8) univ_stui.name setw(8) univ_stui.sex setw(6) univ_stui.age setw(3) (univ_stui.class_
9、infor)0 0 setw(3) (univ_stui.class_infor)1 setw(7) univ_stui.major_grade setw(7) univ_stui.higher_math_grade setw(7) univ_stui.english_grade setw(7) univ_stui.programming_grade endl endl;return true;cout 没有找到该学生 endl; return false;bool BaseOperate:addRecordInPupil(string no) for (int i = 0; i pupil_
10、num; i+) if (pupili.no = no) return false;pupilpupil_num.no = no;cout pupilpupil_num.name;cout pupilpupil_num.sex;cout pupilpupil_num.age;cout pupilpupil_num.class_infor0;cout pupilpupil_num.class_infor1; cout pupilpupil_num.chinese_grade;cout pupilpupil_num.math_grade;cout pupilpupil_num.english_gr
11、ade;pupilpupil_num.total_grade = pupilpupil_num.chinese_grade + pupilpupil_num.math_grade + pupilpupil_num.english_grade;pupil_num+;return true; bool BaseOperate:addRecordInMid(string no) for (int i = 0; i mid_stu_num; i+) if (mid_stui.no = no) return false;mid_stumid_stu_num.no = no;cout mid_stumid
12、_stu_num.name;cout mid_stumid_stu_num.sex;cout mid_stumid_stu_num.age;cout mid_stumid_stu_num.class_infor0;cout mid_stumid_stu_num.class_infor1; cout mid_stumid_stu_num.chinese_grade;cout mid_stumid_stu_num.math_grade;cout mid_stumid_stu_num.english_grade;cout mid_stumid_stu_num.geography_grade;cout
13、 mid_stumid_stu_num.history_grade;mid_stumid_stu_num.total_grade = mid_stumid_stu_num.chinese_grade + mid_stumid_stu_num.math_grade + mid_stumid_stu_num.english_grade + mid_stumid_stu_num.geography_grade + mid_stumid_stu_num.history_grade;mid_stu_num+; return true; bool BaseOperate:addRecordInUniv(s
14、tring no) for (int i = 0; i univ_stu_num; i+) if (univ_stui.no = no) return false;univ_stuuniv_stu_num.no = no;cout univ_stuuniv_stu_num.name;cout univ_stuuniv_stu_num.sex;cout univ_stuuniv_stu_num.age;cout univ_stuuniv_stu_num.class_infor0;cout univ_stuuniv_stu_num.class_infor1; cout univ_stuuniv_s
15、tu_num.major_grade;cout univ_stuuniv_stu_num.english_grade;cout univ_stuuniv_stu_num.higher_math_grade;cout univ_stuuniv_stu_num.programming_grade;univ_stuuniv_stu_num.total_grade = univ_stuuniv_stu_num.major_grade + univ_stuuniv_stu_num.english_grade + univ_stuuniv_stu_num.higher_math_grade + univ_
16、stuuniv_stu_num.programming_grade;univ_stu_num+;return true; bool BaseOperate:deleteRecordInPupil(string no) int index = -1;for (int i = 0; i pupil_num; i+) if (no = pupili.no) index = i;break;if (index = -1)return false; while (index = pupil_num) break;pupilindex.no = pupilindex + 1.no;pupilindex.n
17、ame = pupilindex + 1.name;pupilindex.age = pupilindex + 1.age;pupilindex.sex = pupilindex + 1.sex;(pupilindex.class_infor)0 = (pupilindex + 1.class_infor)0;(pupilindex.class_infor)1 = (pupilindex + 1.class_infor)1;pupilindex.chinese_grade = pupilindex + 1.chinese_grade;pupilindex.math_grade = pupili
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学生 成绩管理系统 33
限制150内