#include<iostream>
using namespace std;
using std::cout;
using std::cin;
#include<string>
using std::string;
using std::getline;
class book
{
private: string Book_Title;
private: int Book_ISBN;
private: string Author_Name;
//defualt constructor
public: book()
{
}
//Setter Functions
public: void setbook(string tit, string A_name, int isbn)
{
Book_Title=tit;
Author_Name=A_name;
Book_ISBN=isbn;
}
// getter Functions
public: string getbook_Title()
{
return Book_Title;
}
public: string getbook_Author_Name()
{
return Author_Name;
}
public: int getbook_ISBN()
{
return Book_ISBN;
}
};
int main()
{
book mybook= book();
string Author_Name;
string Book_Title;
int isbn;
cout<<"Enter the Author Name == ";
getline(cin,Author_Name);
cout<<"\n";
cout<<"Enter the Book Title == ";
getline(cin,Book_Title);
cout<<"\n";
cout<<"Enter the ISBN NO == ";
cin>>isbn;
cout<<"\n";
mybook.setbook(Book_Title,Author_Name,isbn);
cout<<"Book TITLE == "<<mybook.getbook_Title()<<endl;
cout<<"Author Name == "<<mybook.getbook_Author_Name()<<endl;
cout<<"ISBN NO == "<<mybook.getbook_ISBN()<<endl;
getchar();
return 0;
}
using namespace std;
using std::cout;
using std::cin;
#include<string>
using std::string;
using std::getline;
class book
{
private: string Book_Title;
private: int Book_ISBN;
private: string Author_Name;
//defualt constructor
public: book()
{
}
//Setter Functions
public: void setbook(string tit, string A_name, int isbn)
{
Book_Title=tit;
Author_Name=A_name;
Book_ISBN=isbn;
}
// getter Functions
public: string getbook_Title()
{
return Book_Title;
}
public: string getbook_Author_Name()
{
return Author_Name;
}
public: int getbook_ISBN()
{
return Book_ISBN;
}
};
int main()
{
book mybook= book();
string Author_Name;
string Book_Title;
int isbn;
cout<<"Enter the Author Name == ";
getline(cin,Author_Name);
cout<<"\n";
cout<<"Enter the Book Title == ";
getline(cin,Book_Title);
cout<<"\n";
cout<<"Enter the ISBN NO == ";
cin>>isbn;
cout<<"\n";
mybook.setbook(Book_Title,Author_Name,isbn);
cout<<"Book TITLE == "<<mybook.getbook_Title()<<endl;
cout<<"Author Name == "<<mybook.getbook_Author_Name()<<endl;
cout<<"ISBN NO == "<<mybook.getbook_ISBN()<<endl;
getchar();
return 0;
}
No comments:
Post a Comment