Constructor Call Order
easyQuestion 126A base class Vehicle has been provided with a protected int speed and a constructor that sets it.
A derived class Car publicly inherits from Vehicle and has an additional int member doors. The Car constructor has been declared but not implemented.
Your task is to implement the Car constructor using an initialization list. It must call the Vehicle base constructor to set speed, and also initialize doors.
Do NOT include a main function. Your code will be tested automatically.
Expected output
Speed: 120 Doors: 4
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Inheritance
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.