Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string.h>
- using namespace std;
- class card{
- string title;
- string author;
- int copies;
- public:
- int store(string ch,string kh, int a);
- void display();
- } ;
- int card::store(string ch, string kh, int a)
- {
- title = ch;
- author = kh;
- copies=a;
- return 0;
- }
- void card::display()
- {
- cout<<"Book's name is : "<<title<<endl;
- cout<<"Authors name is : "<<author<<endl;
- cout<<"Number of copies on hand : "<<copies<<endl;
- return ;
- }
- int main()
- {
- card c1,c2;
- c1.store("C Programming", "Kamarujjaman Niton", 1);
- c2.store("Jaba Programming", "Harbert Schildt", 1);
- c1.display();
- c2.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement