Doubt in the Aggregation code C++

In this aggregation code, the car is a whole class, and steering_wheel, doors, tires are part classes. Since a car has 4 doors, 4 tyres, the cardinality is 4 respectively for doors and tyres. The cardinality of steering wheel is 1.

Aim is to input car members and then its part classes i.e Steering wheel, Doors, Tyres. And then to output the values in a descriptive manner.

This code is running but at runtime, it is not printing accurate values of character arrays.

#include

#include

using namespace std;

class steering_wheel
{

char model[50];

float radius;

public:

steering_wheel(char *m,float r)

{

strcpy(model,m);

radius=r;

}

void getstr()

{

cout<<"\nEnter the model no. of steering wheel ";

cin>>model;

cout<<"\nEnter the radius of the steering wheel ";

cin>>radius;

}

void putstr()

{

cout<<"\nSteering Wheel ";

cout<<"\nModel No. : "<<model;

cout<<"\nRadius : "<<radius;

}

};

class door

{

char model[50];

char color[50];

public:

door(char *m,char *c)

{

strcpy(model,m);

strcpy(color,c);

}

void getdoor()

{

cout<<"\nEnter the model no. of door ";

cin>>model;

cout<<"\nEnter the color of door ";

cin>>color;

}

void putdoor()

{

cout<<"\nDoors ";

cout<<"\nModel No. : "<<model;

cout<<"\nColor : "<<color;

}

};

class tire

{

char brand[50];

float radius;

public:

tire(char *b,float r)

{

strcpy(brand,b);

radius=r;

}

void gettire()

{

cout<<"\nEnter the tire maker company ";

cin>>brand;

cout<<"\nEnter the radius of the tire ";

cin>>radius;

}

void puttire()

{

cout<<"\nTire ";

cout<<"\nCompany Name : "<<brand;

cout<<"\nRadius : "<<radius;

}

};

steering_wheel* assignstr()

{

steering_wheel *sptr;

sptr=new steering_wheel("MERC-STR11",15.5);

return sptr;

}

door* assigndr()

{

door *dptr;

door dobj[4]={door("MERC-DR10","MATTE-BLACK"),door("MERC-DR11","MATTE-BLACK"),door("MERC-DR12","MATTE-BLACK"),door("MERC-DR13","MATTE-BLACK")};

dptr=dobj;

return dptr;

}

tire* assigntr()

{

tire *tptr;

tire tobj[4]={tire("GOOD-YEAR",24.5),tire("MRF",24.5),tire("JK-TYRE",24.5),tire("GOOD-YEAR",24.5)};

tptr=tobj;

return tptr;

}

class car

{

char maker[50];

char type[50];

char color[50];

steering_wheel *sptr;

door *dptr;

tire *tptr;

public:

car(char *m,char *t,char *c,steering_wheel *p1,door *p2,tire *p3)
{

    strcpy(maker,m);

    strcpy(type,t);

    strcpy(color,c);

    sptr=p1;

    dptr=p2;

    tptr=p3;

}

void getcar()

{
    int i;

    cout<<"\nEnter the car maker ";

    cin>>maker;

    cout<<"\nEnter the car type ";

    cin>>type;

    cout<<"\nEnter the car color ";

    cin>>color;

    sptr->getstr();

    for(i=0;i<4;i++)

    {

        dptr[i].getdoor();

    }

    for(i=0;i<4;i++)

    {

        tptr[i].gettire();
    }


}

void putcar()
{

    int i;

    cout<<"\nCAR";

    cout<<"\nCar maker : "<<maker;

    cout<<"\nCar type : "<<type;

    cout<<"\nCar color : "<<color;

    sptr->putstr();

    for(i=0;i<4;i++)

    {

      dptr[i].putdoor();

    }

    for(i=0;i<4;i++)

    {

      tptr[i].puttire();

    }
}

};

int main()

{

steering_wheel *sptr;

door *dptr;

tire *tptr;

sptr=assignstr();

dptr=assigndr();

tptr=assigntr();

car cobj("Mercedes","Sedan","Olive-Green",sptr,dptr,tptr);

cobj.getcar();

cobj.putcar();

return 0;

}