简答题:请使用VC6或使用【答题】菜单打开考生文件夹proj2下的工程proj2,其中定义了vehiele类,并派生出motor

  • 题目分类:C++
  • 题目类型:简答题
  • 查看权限:VIP
题目内容:
请使用VC6或使用【答题】菜单打开考生文件夹proj2下的工程proj2,其中定义了vehiele类,并派生出motorcar类和bicycle类。然后以motorcar和bicycle作为基类,再派生出motorcycle类。要求将Vehicle作为虚基类,避免二义性问题。请在程序中的横线处填写适当的代码并删除横线,以实现上述类定义。此程序的正确输出结果应为:
80
150
100
1
注意:只能在横线处填写适当的代码,不要改动程序中的其他内容,也不要删除或移动“//****found****”。
#include<iostream.h>
class vehicle
{
private:
int MaxSpeed;
int Weight;
public:
//*************found************
vehicle(int maxspeed,int weight):——
~vehicle(){};
int getMaxSpeed(){return MaxSpeed;}
int getWeight(){retum Weight;}
};
//****************found************
class bicycle:——public vehicle
{
private:
int Height;
public:
bicycle(int maxspeed,int weight,int height):vehicle(maxspeed,weight),Height(height){}
int getHeight(){retum Height;};
};
//*******************found**************
class motorcar:——public vehicle
{
private:
int SeatNum;
public:
motorcar(int maxspeed。int weight,int seatnum):vehicle(maxspeed,weight),SeatNum(seatnum){}
int getSeatNum(){return SeatNum;};
};
//*****************found***************
class motorcycle:——
{
public:
motorcycle(int maxspeed,int weight,int height):vehicle(maxspeed,weight),bicycle(maxspeed,weight,
height),motorcar(maxspeed,weight,1){}
};
void main()
{
motorcycle a(80,150,100);
cout<<a.getMaxSpeed()<<endl;
cout<<a.getWeight()<<endl;
cout<<a.getHeight()<<endl;
cout<<a.getSeatNum()<<endl;
}
参考答案:
答案解析:

比较适合在保险新产品销售的初期使用的定价策略是(  )。

比较适合在保险新产品销售的初期使用的定价策略是(  )。A.心理定价策略 B.促销定价策略 C.投资回报定价策略 D.早期获利价格策略

查看答案

营销情报系统面向的部门是(  )。

营销情报系统面向的部门是(  )。A.质管部门 B.财务部门 C.营销部门 D.规划部门

查看答案

在现存的营销观念中,最全面的是(  )。

在现存的营销观念中,最全面的是(  )。A.生产观念 B.推销观念 C.产品观念 D.社会营销观念

查看答案

对于提高顾客满意度,市场营销中比较合适的做法是(  )。

对于提高顾客满意度,市场营销中比较合适的做法是(  )。A.让顾客的期望值较低,而实际价值很高,这样顾客会很满意 B.让顾客的期望值高于实际价值,吸引更多的顾客

查看答案

我国《保险法》规定了(  )。

我国《保险法》规定了(  )。A.再保险人可以向原投保人索取保险费,但原被保险人不得向再保险人提出索赔 B.再保险人不得向原投保人索取保险费,但原被保险人可以向

查看答案