I am trying to write a program with 5 data members constructor initalize the first 3 data members. A displayCarDetails member function should display all the data members and its values.
The problem is that it does not display it.
The problem is that this code does not compile, for many many reasons. For example, on line 71 you try to create an object of type MotorVehicle, and no such type exists. C++ is case sensitive.
Your compiler will have told you about the errors. You should read what the compiler says to you. You cannot run programs that don't even compile.
Other problems:
Constructor uses M instead of m.
You try to use the member variable make. Which does not exist.
You try to use the member variable fuelType. Which does not exist.
You try to use the member variable yearofManufacture. Which does not exist.
You try to use the member variable color. Which does not exist.
You try to use the member variable engineCapacity. Which does not exist.
You try to create an object using a constructor which accepts THREE parameters, {"Skoda Octavia", "diesel", 2003} but the constructor expects FIVE parameters (std::string make, std::string fuelType, int yearofManufacture, std::string color, int engineCapacity)