class Outfit
{
char OCode[15];
char OType[15];
int OSize;
char OFabric[15];
float OPrice;
void InitPrice()
{
if(strcmp(OFabric,"DENIM")==0)
{
if(strcmp(OType,"TROUSER")==0)
OPrice = 1500;
else if(strcmp(OType,"JACKET")==0)OPrice=2500;
}
else
{
if(strcmp(OType,"TROUSER")==0) Price=1500-1500*0.25;
else if(strcmp(OType,"JACKET")==0) Price=2500-2500*0.25;
}
}
public:
Outfit()
strcpy(OCode,"NOT ASSIGNED");
strcpy(OType,"NOT ASSIGNED");
strcpy(OFabric,"NOT ASSIGNED");
OSize=0; OPrice=0;
}
void Input()
{
cout<"Enter code";
gets(OCode);
cout<<"\nEnter type:";
gets(OType); cout<<"\nEnter Size:";
cin>>OSize;
cout<<"\nEnter Material";
gets(OFabric); cout<<"\nEnter Price:";
cin>>OPrice; InitPrice();
}
void Display()
{
cout<<"\nCode:"<<OCode<<endl;
cout<<"\nType:"<<OType<<endl;
cout<<"\nSize:"<<OSize<<endl;
cout<<"\nMaterial:"<<OFabric<<endl;
cout<<"\nPrice:"<<OPrice<<endl;
}
};