A class hierarchy is composed of the following three (3) classes:
The class hierarchy has an inheritance structure given by the UML class diagram below see image.
In separate file MotorVehicleHierarchy.cpp provided to you, there are:
Please note the following:
(1) Implement all classes so that execution of MotorVehicle Hierarchy.cpp outputs to the screen the following text in green (there are NO blank lines after the first line of text):
MotorVehicle 50 20 4 500 in construction
Automobile 50 20 4 500 4 in construction
Output v1: 50 20 4 500 4
Output new v1: 100 75 6 1000 4
MotorVehicle 100 75 6 1000 in construction
Automobile 100 75 6 1000 4 being copied
Output c2: 100 75 6 1000 4
MotorVehicle 200 100 8 5000 in construction
Automobile 200 100 8 5000 4 in construction
MotorVehicle 201 101 9 5001 in construction
Automobile 201 101 9 5001 5 being copied
Automobile 201 101 9 5001 5 in destruction
MotorVehicle 201 101 9 5001 in destruction
Output after ++c3 and c3++: 202 102 10 5002 6
MotorVehicle 50 20 4 500 in construction
Automobile 50 20 4 500 4 in construction
MotorVehicle 50 20 4 500 in construction
Automobile 50 20 4 500 4 in construction
MotorVehicle 50 20 4 500 in construction
Automobile 50 20 4 500 4 in construction
Automobile 402 252 22 7002 14 in destruction
MotorVehicle 402 252 22 7002 in destruction
Automobile 200 150 12 2000 8 in destruction
MotorVehicle 200 150 12 2000 in destruction
Output c4: 402 252 22 7002 14
MotorVehicle 50 20 4 500 in construction
Automobile 50 20 4 500 4 in construction
HybridAuto 50 20 4 500 4 2 0 0 in construction
Output hc1 with bidArray IDs: 50 20 4 500 4 6 10 20 30 40 50 60
MotorVehicle 50 20 4 500 in construction
Automobile 50 20 4 500 4 in construction
HybridAuto 50 20 4 500 4 2 0 0 in construction
Output hc2: 50 20 4 500 4 2 0 0
MotorVehicle 50 20 4 500 in construction
Automobile 50 20 4 500 4 in construction
HybridAuto 50 20 4 500 4 2 0 0 being copied
Output hc3: 50 20 4 500 4 2 0 0
Output hc2 after assignment: 50 20 4 500 4 6 10 20 30 40 50 60
Output hc2 after change with int: 50 20 4 1000 4 6 10 20 30 40 50 60
Output hc2 after change with float: 50 20 4 2300 4 6 10 20 30 40 50 60
HybridAuto 50 20 4 500 4 2 0 0 in destruction
Automobile 50 20 4 500 4 in destruction
MotorVehicle 50 20 4 500 in destruction
HybridAuto 50 20 4 2300 4 6 10 20 30 40 50 60 in destruction
Automobile 50 20 4 2300 4 in destruction
MotorVehicle 50 20 4 2300 in destruction
HybridAuto 50 20 4 500 4 6 10 20 30 40 50 60 in destruction
Automobile 50 20 4 500 4 in destruction
MotorVehicle 50 20 4 500 in destruction
Automobile 402 252 22 7002 14 in destruction
MotorVehicle 402 252 22 7002 in destruction
Automobile 202 102 10 5002 6 in destruction
MotorVehicle 202 102 10 5002 in destruction
Automobile 100 75 6 1000 4 in destruction
MotorVehicle 100 75 6 1000 in destruction
Automobile 100 75 6 1000 4 in destruction
MotorVehicle 100 75 6 1000 in destruction
(2) Implement all classes so that execution of MotorVehicleHierarchy.cpp outputs to a file named COEN244_Final.txt the following text in brown (there are NO blank lines after the first line of text):
100 75 6 1000 4
100 75 6 1000 4
202 102 10 5002 6
402 252 22 7002 14
50 20 4 500 4 6 10 20 30 40 50 60
50 20 4 500 4 2 0 0
50 20 4 500 4 2 0 0
50 20 4 500 4 6 10 20 30 40 50 60
50 20 4 1000 4 6 10 20 30 40 50 60
50 20 4 2300 4 6 10 20 30 40 50 60