Question: C++ classes and objects Complete right (a) class Vehicle with a constructor with one parame- ter to initialise model, (b) class Car inheriting public from
C++ classes and objects



Complete right (a) class Vehicle with a constructor with one parame- ter to initialise model, (b) class Car inheriting public from Vehicle with (c) a constructor with two parameters to initialise both attributes and (d) a member function print outputting the model and in round brackets the power in kW, (e) class Cabrio inheriting public from Car with (f) a constructor with three parameters to initialise its three attributes and (g) a member function print printing string "Cabrio", calling same name method from its direct upper class and outputting "with retractable hardtop" in case of value true of the Bool- ean attribute. In function main below initialise variables (h) cl with an object and a pointer c2 to a new object on heap of type Cabrio with the values shown in the example below. Send to (i) object cl and to (k) the object c2 points to each a message print! ; PO8 (2020-01-17) Vehicle #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
