Website Summary Files Commits Branches @commit @diff @stats
path: root / Week10 / Exercise03 / Shop.h
diff options
context:
space:
mode:
1 files changed, 35 insertions, 0 deletions
-rw-r--r--Week10/Exercise03/Shop.h35
diff --git a/Week10/Exercise03/Shop.h b/Week10/Exercise03/Shop.h
new file mode 100644
index 0000000..ce1c8de
--- /dev/null
+++ b/Week10/Exercise03/Shop.h
@@ -0,0 +1,35 @@
+#ifndef _SHOP
+#define _SHOP
+
+#include "Inventory.h"
+#include "Date.h"
+
+struct Sale {
+ char productName[PRODUCT_NAME_LENGTH];
+ unsigned quantity;
+ Date date;
+};
+
+class Shop : public Inventory {
+ Sale* sales;
+ unsigned salesCount;
+ unsigned salesAlloc;
+
+ void free();
+ void copyFrom(const Shop& other);
+
+ void resize();
+
+public:
+ Shop();
+ ~Shop();
+ Shop(const Shop& other);
+ Shop& operator=(const Shop& other);
+
+ Shop(Shop&& other);
+ Shop& operator=(Shop&& other);
+
+ bool Purchase(const Sale& sale);
+};
+
+#endif /* _SHOP */