student.cpp

来自「文件包含了很多VC实例」· C++ 代码 · 共 57 行

CPP
57
字号
#include <iostream>
#include "student.h"
using namespace std;
CStudent::CStudent()
{
	strName = "General Student";
	chinese = 0 ;
	math = 0 ;
	english = 0 ;
}
CStudent::CStudent(std::string Name, double c, double m, double e)
{
	strName = Name ;
	chinese = c ;
	math = m ;
	english = e ;
}
void CStudent::SetChinese(double a)
{
	chinese = a;
}
void CStudent::SetEnglish(double a)
{
	english = a;
}
void CStudent::SetMath(double a)
{
	math = a;
}
double CStudent::returnChinese()
{
	return chinese ;
}
double CStudent::returnEnglish()
{
	return english ; 
}
double CStudent::returnMath()
{
	return math ;
}
double CStudent::returnTotalPreformance()
{
	return chinese + math + english ;
}
double CStudent::returnAverage()
{
	return (chinese + math + english)/3;
}
string CStudent::returnName()
{
	return strName;
}
void CStudent::SetName(std::string c)
{
	strName = c;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?