Question: Study the following code snippet: class Car { public: Car ( ) ; Car ( double new _ speed ) ; double get _ speed

Study the following code snippet:
class Car
{
public:
Car();
Car(double new_speed);
double get_speed() const;
private:
double speed;
};
Car::Car()
{
speed =0;
}
Car::Car(double new_speed)
{
speed = new_speed;
}
double Car::get_speed()
{
return speed;
}
class AeroCar : public Car
{
public:
AeroCar();
AeroCar(double new_height, double new_speed);
void display_data() const;
private:
double height;
};
AeroCar::AeroCar()
{
height =0;
}
AeroCar::AeroCar(double new_height, double new_speed) : Car(new_speed)
{
height = new_height;
}
void AeroCar::display_data() const
{
cout << Car::get_speed()<< height << endl;
}
int main()
{
Car c1;
Car c2(10);
AeroCar ac1(20,10);
c1= ac1;
return 0;
}
Which one of the following statements is false?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!