Website Summary Files Commits Branches @commit @diff @stats
path: root / Week03 / Exercise01 / main.cpp
diff options
context:
space:
mode:
Commit5624cd9b63bec13fc464a3d7820d703abd8de113 (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-03-08 19:54:32 +0200
Committer
 Syndamia <kamen@syndamia.com>
2026-03-08 19:54:32 +0200
Files8d9915e71a7b9e757752fe3b379138804e51a8b7 /Week03/Exercise01/main.cpp
oop-2025-solutions-5624cd9b63bec13fc464a3d7820d703abd8de113.tar
oop-2025-solutions-5624cd9b63bec13fc464a3d7820d703abd8de113.tar.gz
oop-2025-solutions-5624cd9b63bec13fc464a3d7820d703abd8de113.zip
Parentf18c44909c604a01bb0265d006a84223ee88d603 (diff)
feat(Week03): Add solution to first exercise
1 files changed, 25 insertions, 0 deletions
-rw-r--r--Week03/Exercise01/main.cpp25
diff --git a/Week03/Exercise01/main.cpp b/Week03/Exercise01/main.cpp
new file mode 100644
index 0000000..a018dd5
--- /dev/null
+++ b/Week03/Exercise01/main.cpp
@@ -0,0 +1,25 @@
+#include <iostream>
+#include <cstring>
+#include "Shop.h"
+
+int main() {
+ Shop shop = newShop();
+
+ User admin;
+ strcpy(admin.name, "admin");
+ strcpy(admin.password, "admin");
+ admin.isAdmin = true;
+
+ shop.users.add(admin);
+
+ char command;
+ while (true) {
+ std::cin >> command;
+ std::cin.ignore();
+ shop.runCommand(command);
+ }
+
+ deleteShop(shop);
+
+ return 0;
+}