Guest User

Untitled

a guest
Jul 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. // magazine.h
  2. #ifndef MAGAZINE_H
  3. #define MAGAZINE_H
  4. #include <string>
  5. using namespace std;
  6. class CMagazine{
  7. public:
  8.     CMagazine();
  9.     CMagazine(string tt,long cd,int vol);
  10.     void showMagazineDetail();
  11. private:
  12.     int volume;
  13.     string title;
  14.     long code;
  15. };
  16. #endif
  17.  
  18. // magazine.cpp
  19. #include <iostream>
  20. #include "magazine.h"
  21. using namespace std;
  22. CMagazine::CMagazine() {}
  23. CMagazine::CMagazine(string tt, long cd, int vol) {
  24.     volume = vol;
  25.     title = tt;
  26.     code = cd;
  27. }
  28. void CMagazine::showMagazineDetail() {
  29.     cout<<"[杂志]---"<<"(杂志名):"<<title<<","<<"(条形码):"<<code<<","<<"(卷号):"<<volume<<endl;
  30. }
Add Comment
Please, Sign In to add comment