student.cpp

来自「大二时做的课程设计」· C++ 代码 · 共 47 行

CPP
47
字号
// Student.cpp: implementation of the CStudent class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Student.h"
#include <string>
using namespace std;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

string& CStudent::ID(){
	return _ID;
}
string& CStudent::SN(){
	return SequenceNumber;
}
string& CStudent::Name(){
	return name;
}


int& CStudent::operator[](int index){
	switch(index)
	{
	case 0:
		return math_score;
		break;
	case 1:
		return phys_score;
		break;
	case 2:
		return math1_score ;
		break;
	case 3:
		return comp_score;
		break;
	case 4:
		return engl_score ;
		break;
	default:
		throw "You must give the index no big than 4 and no less than 0!";
		break;
	}
}

⌨️ 快捷键说明

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