Question: I need help creating functions for 2 classes (with headers and source files) with an inheritence relationship in c++. The base class is Vehicle and

I need help creating functions for 2 classes (with headers and source files) with an inheritence relationship in c++. The base class is Vehicle and the derived class is Car. The following pictures details how to set up the two classes. I've already created the header files(included here:https://docs.google.com/document/d/1Z869BC0wGInYDTsg6vjFf7AKCNXtgx49hXq3GM-a66s/edit?usp=sharing). Now, I need help with writing the source file functions for the two classes.

I'm also supposed to test the classes against a test driver file (included here:https://docs.google.com/document/d/11uFW2jiVOcltd4bk6Wg5GFfRgHTWiwZsBWOkAPz9eZI/edit?usp=sharing). But honestly, you don't have to worry about that part if you don't have the time. I just want to see how to write the functions for the two classes. Thank you for your help!I need help creating functions for 2 classes (with headers and sourcefiles) with an inheritence relationship in c++. The base class is Vehicleand the derived class is Car. The following pictures details how to

memlbere hicle on the cath The Vehicle Class will contain the following protected data members: m_lla, a float array of size 3 which represents the location of the vehicle on the earth (LLA stands for longitude-Latitude-Altitude, which are the 3 values stored within the array). m_vin, a const int which represent a unique VIN - Vehicle Identification Number (no two vehicles can ever exist with the same m_vin) and the following private data members: s_idgen, a static int which is used by the class to generate a unique identifier to initialize m_vin whenever a new Vehicle object is instantiated - how can you achieve this behavior? (Hint Remember how you have been using static variables so far to keep track of the count of a class' active objects) and will have the following public methods: Default Constructor - will leave everything uninitialized (except m_vin which has to follow the above described specifications). When it gets called, it should produce a debug output: "Vehicle #vin: Default-ctor" (where vin the actual member value) Parameterized Constructor - will create a new object based on a desired value for the VIN ssed by-Value (it is however able to assign a different value if it runs into any danger of assigning conflicting values), and a desired set of values for LLA passed by-Address (a pointer to float data). When it gets called, it should produce a debug output: "Vehicle #vin: Parametrized-ctor" (where vin the actual member value) Copy Constructor - will create a new object based on the values of another Vehicle object (except m_vin which has to follow the above described specifications). When it gets called, it should produce a debug output: "Vehicle #vin: Copy-ctor" (where vin the actual member value) Destructor - called whenever an object gets destroyed. When it gets called, it should produce a debug output: "Vehicle #vin: Dtor" (where vin the actual member value)

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!