I have made a little snippet of what my project is essentially based on - except much bigger. I am having a hard to grasping this particular concept. I need to make a car class which inherits the vehicle class and then there must be separate classes such as window, door, engine etc... I need to access those classes through the car class to adjust its "properties"
#include <iostream>
usingnamespace std;
class Vehicle
{
virtualvoid print() = 0;
};
class Car : public Vehicle
{
virtualvoid print();
Wheel tires[4];
};
class Wheel
{
public:
int pressure = 0;
int inflate(int psi)
{
pressure = pressure + psi;
}
};
int main()
{
//What would I have to put here or anywhere else to increase the pressure of a car object's FIRST tire's pressure
}