Advertisement
sukarnapaul

Untitled

Apr 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include<iostream>
  2. #include<string.h>
  3. using namespace std;
  4.  
  5. class card{
  6. string title;
  7. string author;
  8. int copies;
  9. public:
  10. int store(string ch,string kh, int a);
  11. void display();
  12. } ;
  13.  
  14. int card::store(string ch, string kh, int a)
  15. {
  16. title = ch;
  17. author = kh;
  18. copies=a;
  19. return 0;
  20. }
  21.  
  22. void card::display()
  23. {
  24. cout<<"Book's name is : "<<title<<endl;
  25. cout<<"Authors name is : "<<author<<endl;
  26. cout<<"Number of copies on hand : "<<copies<<endl;
  27. return ;
  28. }
  29.  
  30. int main()
  31. {
  32. card c1,c2;
  33.  
  34. c1.store("C Programming", "Kamarujjaman Niton", 1);
  35. c2.store("Jaba Programming", "Harbert Schildt", 1);
  36.  
  37. c1.display();
  38. c2.display();
  39.  
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement