Website Summary Files Commits Branches @commit @diff @stats
path: root / Week02 / Exercise05 / warehouse.cpp
diff options
context:
space:
mode:
1 files changed, 9 insertions, 0 deletions
-rw-r--r--Week02/Exercise05/warehouse.cpp9
diff --git a/Week02/Exercise05/warehouse.cpp b/Week02/Exercise05/warehouse.cpp
new file mode 100644
index 0000000..ea968ab
--- /dev/null
+++ b/Week02/Exercise05/warehouse.cpp
@@ -0,0 +1,9 @@
+#include "warehouse.h"
+
+bool Warehouse::storePackage(const Package& p) {
+ if (storedPackages >= packageCapacity)
+ return false;
+
+ packages[storedPackages++] = p;
+ return true;
+}