Computer Science, asked by anjuc3926, 9 months ago

define a class book store having the following specification
Data member :name of the book ,author,publication and cast​

Answers

Answered by dreamrob
0

Program in C++

#include<iostream>

#include<string.h>

using namespace std;

class book

{

private:

 string book_name, author, publication, cast;

public:

 void input()

 {

  cout<<"Enter name of book : ";

  cin>>book_name;

  cout<<"Enter author : ";

  cin>>author;

  cout<<"Enter publication : ";

  cin>>publication;

  cout<<"Enter cast : ";

  cin>>cast;

 }

 void display()

 {

  cout<<"\nBook Name : "<<book_name<<endl;

  cout<<"Author : "<<author<<endl;

  cout<<"Publication : "<<publication<<endl;

  cout<<"Cast : "<<cast<<endl;

 }  

};

int main()

{

book b;

b.input();

b.display();

return 0;

}

Similar questions