#include<iostream>
#include<string>
using namespace std;
class BOOK
{
int BOOK_PRICE;
string BOOK_TITLE;
int BOOK_NO;
float TOTAL_COST(int N)
{
int add=N*BOOK_PRICE;
return add;
}
public:
void Getinfo()
{
cout<<"Input Number of the book : ";
cin>>BOOK_NO;
cout<<"Input Title of the book : ";
getline(cin,BOOK_TITLE);
getline(cin,BOOK_TITLE);
cout<<"Input price of the book : ";
cin>>BOOK_PRICE;
}
void Price()
{
int copies;
cout<<"\nInput the number of copies needed for purchase: ";
cin>>copies;
float sum=TOTAL_COST(copies);
cout<<"Total Price : "<<sum;
}
void display()
{
cout<<"Book Number : "<<BOOK_NO;
cout<<"\nBook Title : "<<BOOK_TITLE;
cout<<"\nPrice : "<<BOOK_PRICE;
Price();
}
};
int main()
{
BOOK book;
book.Getinfo();
book.display();
}
Comments
Leave a comment