班级成绩管理系统

本文介绍了使用C++编程语言设计并实现一个简单的班级成绩管理系统的过程,包括输入、存储和展示学生分数等功能。
摘要由CSDN通过智能技术生成

设计题目

班级成绩管理系统

已知技术参数和设计要求

对一个有N个学生的班级,每个学生有M门课程。该系统实现对班级成绩的录入、显示、修改、排序等操作的管理。

班级信息,课程信息,学生信息自定义。

设计内容与步骤

1、 模块化程序设计。

2、 具体数据结构的定义及其处理数据算法的设计。

3、 锯齿型程序书写格式

4、 程序设计、实现、调试。

5、 课程设计说明书。

设计工作计划与进度安排

1、 程序设计10学时。

2、 实现与调试6学时。

3、 课程设计说明书4学时。

设计考核要求

1、 考勤20%

2、 课程设计说明书30%

3、 答辩、成果演示50%




#include<iostream>

#include<string>
#include<cstring>
#include<algorithm>
#include<iterator>
#include <iomanip>
using namespace std;
class Student
{
public:
friend istream& operator>>(istream&, Student&);
friend ostream& operator<<(ostream&, const Student&);
Student(){}
Student(int id, char sName[], float m, float e, float c, float cn, float sum);
friend bool operator > (const Student&, const Student&);
int ID;//学号
char stuName[20];
float chinese, math, english, cjia;
float sum;//总数
};
Student::Student(int id, char sName[], float m, float c,float e, float cn,float sum):ID(id), chinese(c), math(m),
english(e), cjia(cn)
{
sum = c+m + e + cn;
strcpy(stuName, sName);//字符串复制函数
}
bool operator > (const Student &stu1, const Student &stu2)//重载>运算符
{
return stu1.sum > stu2.sum;
}
istream& operator>>(istream &is, Student &stu)
{


cout << "学生的学号为:"; is >> stu.ID;
cout << "学生的姓名为:"; is >> stu.stuName;
cout << "学生的语文成绩为:"; is >> stu.chinese;
cout << "学生的数学成绩为:"; is >> stu.math;
cout << "学生的英语成绩为:"; is >> stu.english;
cout << "学生的C++成绩为:"; is >> stu.cjia;
stu.sum =stu.chinese+ stu.math + stu.english + stu.cjia;
return is;
}
ostream& operator<<(ostream &os, const Student &stu)
{
os << stu.stuName << "的信息为:" << endl;
os << "学号:" << stu.ID << endl;
os << "语文成绩:" << stu.chinese << endl;
os << "数学成绩:" << stu.math << endl;
os << "英语成绩:" << stu.english << endl;
os << "C++成绩:" << stu.cjia << endl;
os << "总分:" << stu.sum << endl;
return os;
}




void add(Student s[], int i);//添加学生信息
void show(Student s[], int i);//显示学生信息
void change(Student s[], int i, int id);//修改学生信息
void del(Student s[], int i, int id);//删除学生信息
void paixu(Student s[], int i);//排序函数
void search(Student s[], int i, int id);//查找函数






int main()
{
int i = 0;
  • 7
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值