class TestPaper
{
public:
void DoTestPaper(){
StudentName();
TestTitleOne();
TestTitleTwo();
};
void TestTitleOne(){
cout<<"题目一:X国的房价会降下来么?"<<endl;
AnswerOne();
}
void TestTitleTwo(){
cout<<"题目二:说说你的新闻联播的看法?"<<endl;
AnswerTwo();
}
virtual void AnswerOne() = 0;
virtual void AnswerTwo() = 0;
virtual void StudentName() = 0;
};
class XiaoHongTestPaper : public TestPaper
{
public:
void StudentName(){
cout<<"姓名:小红"<<endl;
}
void AnswerOne(){
cout<<"答:相信X,相信国家,明年一定降下来。"<<endl<<endl;
}
void AnswerTwo(){
cout<<"答:新闻联播是我最喜欢的节目啊。"<<endl<<endl;
}
};
class XiaoZhangTestPaper : public TestPaper
{
public:
void StudentName(){
cout<<"姓名:小张"<<endl;
}
void AnswerOne(){
cout<<"答:呵呵,还是去做你的X国梦吧。"<<endl<<endl;
}
void AnswerTwo(){
cout<<"答:我很幸福"<<endl<<endl;
}
};
int main(int argc, char* argv[])
{
XiaoHongTestPaper paper1;
paper1.DoTestPaper();
XiaoZhangTestPaper paper2;
paper2.DoTestPaper();
system("pause");
return 0;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有