(2020年7月整理)奖学金计算系统源代码.doc

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
cout << "┃------------------------------------┃" << endl;
}
int guanli::gameprint1() //打印函数
{
int a;
cout << "继续操作请按1,退出请按0" << endl;
cin >> a;
return a;
}
void guanli::chushi(student *stu) //初始化学生信息函数
static int n = 0;
class exam //成绩类
{
public:
float Math;
float English;
float Sport;
float practise;
float sum;
};
class final : public exam
{
public:
float grade(float a = 0, float b = 0, float c = 0, float d = 0);
{
public:
float pingding();
string name; //姓名
string number; //学号
string major;//专业
char sex[5]; //性别
int money; //奖学金数额
float GPA; //学分绩
midterm first_grade; //上半年考试成绩
final second_grade; //下半年考试成绩
};
float student::pingding()
{
float a, b;
a = (second_grade.Math * 4 + second_grade.English * 3 + second_grade.Sport * 2 + second_grade.practise * 1.5) * 0.5 / 10.5;
{
int i;
for (i = 0; i < n; i++)
stu[i].pingding();
}
void guanli::fun1(student *stu) //录入学生信息函数
{
float a, b, c, d, i;//数学,英语,体育,实践,总成绩
cout << "输入学生姓名,学号,性别,专业" << endl;
cin >> stu[n].name >> stu[n].number >> stu[n].sex >> stu[n].major;
cout << "请选择输入" << stu[n].name << "的成绩" << endl;
cout << "请输入该生上半年成绩--请按--数学英语体育实践的顺序输入,否则默认为0" << endl;
{
sum = a + b + c + d;
return a + b + c + d;
}
float final::grade(float a, float b, float c, float d)
{
sum = a + b + c + d;
return a + b + c + d;
}
class student //学生类
};
class midterm : public exam
{
public:
float grade(float a = 0, float b = 0, float c = 0, float d = 0);
wk.baidu.com};
float midterm::grade(float a, float b, float c, float d)
void fun1(student *stu);
void paihang(student *stu);
void find(student *stu);
void amend(student *stu);
void chushi(student *stu);
};
void guanli::print() //打印界面函数
奖学金计算系统
要求:
输入为某个学期某个年级某个专业的期末成绩
根据输入计算学分绩
按照实际奖学金的评定规则,输出各等奖学金的获奖名单和人数
#include<iostream>
#include<math.h>
#include<string>
#include<fstream>
using namespace std;
{
cout << "┃------------------------------------┃" << endl;
cout << "┃*********奖学金评定*********┃" << endl;
cout << "┃********* 1初始化学生信息*********┃" << endl;
else if (GPA >= 80 && GPA < 90)
money = 1500;
else if (GPA >= 75 && GPA < 80)
money = 750;
else
money = 0;
return GPA;;
}
class guanli
{
public:
void print();
int gameprint1();
cout << "┃********* 2查看奖学金信息*********┃" << endl;
cout << "┃********* 3查询个人奖学金*********┃" << endl;
cout << "┃********* 4修改个人成绩*********┃" << endl;
cout << "┃********* 5退出*********┃" << endl;
cin >> a >> b >> c >> d;
stu[n].first_grade.Math = a;
stu[n].first_grade.English = b;
stu[n].first_grade.Sport = c;
stu[n].first_grade.practise = d;
b = (first_grade.English * 3.5 + first_grade.Math * 4 + first_grade.practise * 1.5 + first_grade.Sport * 2) * 0.5 / 10.5;
GPA = a + b;
if (GPA >= 90)
money = 3000;
相关文档
最新文档