Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // ShoppingList.h
  2. #include <string>
  3. using namespace std;
  4.  
  5.  
  6. class ShoppingList {
  7. private:
  8. struct item {
  9. item* next;
  10. string name;
  11. string category;
  12. float price;
  13. string subcategory;
  14. int priority;
  15. };
  16. int size; // Number of items in Shopping List (Size of shopping list)
  17. item* head = nullptr; // head of shoppingList
  18.  
  19.  
  20. public:
  21. ShoppingList(); // Constructor
  22. ~ShoppingList(); // Deconstructor
  23. ShoppingList(const ShoppingList& copy);
  24. ShoppingList& operator=(const ShoppingList& copy); // Copy Assignment Operator
  25. void insert(string name, float price, string category, string subcategory, int priority);
  26. void remove(string name);
  27. int getSize();
  28. ShoppingList getPriority(int priority);
  29. ShoppingList getCategory(string category);
  30. void printList();
  31.  
  32.  
  33.  
  34.  
  35. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement