#include<iostream>
using namespace std;
class BOOK{
private:
int BNO;
char BOOKTITLE [30];
int COPIES;
float PRICE;
void TOTAL_COST(int N)
{
float tcost;
tcost=PRICE*N;
cout<<tcost;
}
public:
void INPUT( )
{
cout<<"Enter Book Number ";
cin>>BNO;
cout<<"Enter Book Title ";
gets(BOOKTITLE);
cout<<"Enter price per copy ";
cin>>PRICE;
}
void PURCHASE( )
{
int n;
cout<<"Enter number of copies to purchase ";
cin>>n;
cout<<"Total cost is ";
TOTAL_COST(n);
}
};
int main( )
{
BOOK obj;
obj.INPUT( );
obj.PURCHASE( );
return 0;
}
Comments
Leave a comment