#include
#include
class wholesalers
{
public:
char p_name[20];
float cost;
int quantity;
void read()
{
cout<<"ENTER PRODUCT_NAME,PRODUCT_COST,PRODUCT_QUANTITY\n"<
}
void write()
{
cout<<"PRODUCT NAME :"<
};
class retailsalers: public wholesalers
{
int icost;
int t_pieces;
public:
void accept()
{
cout<<"ENTER INCREASE IN COST & NUMBER OF PRODUCTS IN SHOP "<
}
void display()
{
cost+=icost;
cout<<"THE COST OF A PRODUCT IN RETAIL SHOP:"<
};
class consumer :public retailsalers
{
int p_consumed,tcost;
public:
void rd()
{
cout<<"ENTER NUMBER OF PRODUCTS CONSUMED"<
}
void wr()
{
cout<<"PRODUCTS BOUGHT BY CONSUMER :"<
cout<<"TOTAL COST OF PRODUCTS IS :"<
};
void main()
{
clrscr();
consumer x;
x.read();
x.accept();
x.rd();
x.write();
x.display();
x.wr();
getch();
}
OUTPUT:
ENTER PRODUCT_NAME,PRODUCT_COST,PRODUCT_QUANTITY
NOTEBOOKS
15
200
ENTER INCREASE IN COST & NUMBER OF PRODUCTS IN SHOP
5
10
ENTER NUMBER OF PRODUCTS CONSUMED
5
PRODUCT NAME :NOTEBOOKS
PRODUCT COST :15
PRODUCT QUANTITY :200
THE COST OF A PRODUCT IN RETAIL SHOP:20
REMAINING PRODUCTS :10
PRODUCTS BOUGHT BY CONSUMER :5
TOTAL COST OF PRODUCTS IS :100
No comments:
Post a Comment