Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class book{
- string Title;
- string Author;
- string Content;
- public:
- book(string _Title, string _Author, string _Content) {
- _Title = Title;
- _Author = Author;
- _Content = Content;
- }
- void setTitle(string _Title) {
- Title = _Title;
- }
- void setAuthor(string _Author) {
- Author = _Author;
- }
- void setContent(string _Content) {
- Content = _Content;
- }
- void Show() {
- system("color f4");
- cout <<"The book is called: "<< Title << endl;
- system("color f0");
- cout <<"The author of the book is: "<< Author << endl;
- cout <<"Intro: "<< Content << endl;
- }
- };
- int main(){
- string a;
- getline(cin, a);
- string b;
- getline(cin, b);
- string c;
- getline(cin, c);
- book book1(a,b,c);
- book1.setAuthor(a);
- book1.setTitle(b);
- book1.setContent(c);
- book1.Show();
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment