Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. //Header File
  2.  
  3. #include<iostream>
  4. #include<iomanip>
  5. #include<string>
  6.  
  7. #pragma once
  8.  
  9. class Item
  10. {
  11. protected:
  12. std::string title;
  13. std::string description;
  14. double price;
  15. public:
  16. Item();
  17. Item(std::string passTitle, std::string passDescription, double passPrice);
  18. std::string getTitle();
  19. std::string getDescription();
  20. double getPrice();
  21. void setTitle(std::string x);
  22. void setDescription(std::string x);
  23. void setPrice(double x);
  24. virtual void print() = 0;
  25. };
  26.  
  27. class Book : public Item
  28. {
  29. protected:
  30. int pageCount;
  31. public:
  32. Book();
  33. Book(std::string passTitle, std::string passDescription, double passPrice, int passPageCount);
  34. int getPageCount();
  35. void setPagecount(int x);
  36. void print();
  37. };
  38.  
  39. class Movie : public Item
  40. {
  41. protected:
  42. int length;
  43. public:
  44. Movie();
  45. Movie(std::string passTitle, std::string passDescription, double passPrice, int passLength);
  46. int getLength();
  47. void setLength(int x);
  48. void print();
  49. };
  50.  
  51. class CD : public Item
  52. {
  53. protected:
  54. int trackCount;
  55. public:
  56. CD();
  57. CD(std::string passTitle, std::string passDescription, double passPrice, int passTrackCount);
  58. int getTrackCount();
  59. void setTrackCount(int x);
  60. void print();
  61. };
  62.  
  63. class ShoppingCart
  64. {
  65. protected:
  66. int numItemsInCart;
  67. Item ** itemArray;
  68. public:
  69. ShoppingCart(int x);
  70. ShoppingCart();
  71. ~ShoppingCart();
  72. void AddOneItem();
  73. void addItems();
  74. void printItems();
  75. };
  76.  
  77. class Customer
  78. {
  79. protected:
  80. int userID;
  81. ShoppingCart * customerShoppingCart;
  82. std::string firstName, lastName;
  83. public:
  84. Customer();
  85. Customer(std::string uFirstName, std::string uLastName, int numItems);
  86. ~Customer();
  87. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement