Question: Use the following code to answer the following 2 sub-questions. Note that some private and protected data members as well as function definitions (ie, bodies)

 Use the following code to answer the following 2 sub-questions. Note

Use the following code to answer the following 2 sub-questions. Note that some private and protected data members as well as function definitions (ie, bodies) are omitted for simplicity. class Vehicle private: int capacity public: Vehicle(int capacity) this->capacity - capacity ) void move (double distance) 1) class Car: public vehicle public: Car(int capacity): Vehicle (capacity) ( . ) void move (double distance) {-} } int main() { Vehicle + vehicle = new Car (5); vehicle->move (10.0); //line 2 1 When the main function is executed in the code above, line 2 will call the move function of which of the following classes? None Car Both Car and Vehicle O Vehicle

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 Databases Questions!