教师课程管理系统(c++课程设计源代码)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#include
#include
#include
#include
#include
#include
using namespace std;
using std::string;
class ke;
ostream&operator<<(ostream&dist,ke&k);
istream&operator>>(istream&sour,ke&k);
class teacher;
ostream&operator<<(ostream&dist,teacher&t);
istream&operator>>(istream&sour,teacher&t);
class ke
{
protected:
static int keID;
string keName;
char keJB;
int keXS;
int keJC;
int keBH;
public:
ke(string name="未命名的课程",char jb='0',int xs=0,int jc=0,int bh=0);
void show();
friend ostream&operator<<(ostream&dist,ke&k);
friend istream&operator>>(istream&sour,ke&k);
int getkeJC(){return keJC;}
string getkeName(){return keName;}
};
int ke::keID=0;
ke::ke(string name,char jb,int xs,int jc,int bh)
{
keID++;
bh=keID;
keName=name;
keJB=jb;
keXS=xs;
keJC=jc;
keBH=bh;
}
void ke::show()
{
cout<<"课程编号:"< cout<<"课程名称:"< cout<<"课程级别:"; switch (keJB) { case '1':cout<<"公共基础课"< case '2':cout<<"专业基础课"< case '3':cout<<"专业课"< case '4':cout<<"公选课"< } cout<<"学时:"< cout<<"基本课酬:"< } ostream&operator<<(ostream&dist,ke&k) { dist< dist< dist< return dist; } istream&operator>>(istream&sour,ke&k) { sour>>k.keBH>>k.keName>>k.keJB>>k.keXS>>k.keJC; return sour; } class keDB:public ke { public: int judge(); void add(); void del(); }; void keDB::add() { cout<<"请输入课程名称:"; cin>>keName; cout<<"1)公共基础课2)专业基础课3)专业课4)公选课"< cout<<"请输入课程级别(序号):"; cin>>keJB; while(keJB!='1'&&keJB!='2'&&keJB!='3'&&keJB!='4') { cout<<"错了!让你输1、2、3、4你还输别的,专业点好不好=_=...."< cout<<"1)公共基础课2)专业基础课3)专业课4)公选课"< cout<<"请重新输入课程级别(序号):"; cin>>keJB; } cout<<"请输入学时:"; cin>>keXS; while(keXS<=0||keXS>=100) { cout<<"要么学时太多超出范围,要么你就输入了什么奇怪的东西,重新输!"< cout<<"请重新输入学时:"; cin>>keXS; } cout<<"请输入基本课酬:"; cin>>keJC; while(keJC<=0||keJC>=100000) { if(keJC>=10000) cout<<"这个价位也太高了吧,你确定不是在洗黑钱?"< else if(keJC<=0) cout<<"给人上课还倒贴钱,脑子进水了吧=_="< cout<<"请重新输入基本课酬:"; cin>>keJC; } cout<<"课程编号(自动生成):"< } void keDB::del() { keName="未命名的课程"; keJB='0'; keXS=0; keJC=0; } int keDB::judge() { return keJB; } class teacher { protected: static int teachID; string teName; int teNo; string teClass; int teNumber; double teMoney; string kName; keDB k[100];