credit.cpp
来自「大二时做的课程设计」· C++ 代码 · 共 42 行
CPP
42 行
// Credit.cpp: implementation of the CCredit class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Credit.h"
#include <iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include "ManageStudent.h"
using namespace std;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCredit::CCredit():math(7.0),phys(4.0),comp(4.0),math1(4.0),engl(6.0){}
double& CCredit::operator[](int index){
switch(index)
{
case 0:
return math;
break;
case 1:
return phys;
break;
case 2:
return math1 ;
break;
case 3:
return comp;
break;
case 4:
return engl ;
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 + -
显示快捷键?