#include<iostream.h>
class item{
private:
int itemno,price;
public:
void getItemDetails()
{
cout<<"Get Item no and price";
cin>>itemno,price;
}
void getItemDetails(int I,int j)
{
itemno=I;
price=j;
}
int cal_amount(int q)
{
return q*price;
}
void printdetails()
{
cout<<itemno<<price;
}
};
void main()
{
item K;
K.getItemDetails(3,45);
int r=K.cal_amount(5);
cout<<"Amount="<<r;
}
class item{
private:
int itemno,price;
public:
void getItemDetails()
{
cout<<"Get Item no and price";
cin>>itemno,price;
}
void getItemDetails(int I,int j)
{
itemno=I;
price=j;
}
int cal_amount(int q)
{
return q*price;
}
void printdetails()
{
cout<<itemno<<price;
}
};
void main()
{
item K;
K.getItemDetails(3,45);
int r=K.cal_amount(5);
cout<<"Amount="<<r;
}
No comments:
Post a Comment