From 945f7e67d6ca8047c961457786fac5e2d9a13d82 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 3 Apr 2026 18:17:51 +0300 Subject: feat(Week07): Add solutions --- Week07/Exercise01/LibraryBanking.h | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Week07/Exercise01/LibraryBanking.h (limited to 'Week07/Exercise01/LibraryBanking.h') diff --git a/Week07/Exercise01/LibraryBanking.h b/Week07/Exercise01/LibraryBanking.h new file mode 100644 index 0000000..08e9d9d --- /dev/null +++ b/Week07/Exercise01/LibraryBanking.h @@ -0,0 +1,40 @@ +#ifndef _LIBRARY_BANKING +#define _LIBRARY_BANKING + +#include "BankClerk.h" +#include "Transaction.h" + +class LibraryBanking { + BankClerk* clerks; + unsigned clerksCount; + unsigned clerksAlloc; + + Transaction* transactions; + unsigned transactionsCount; + unsigned transactionsAlloc; + + void free(); + void copyFrom(const LibraryBanking& other); + + void resizeClerks(); + void resizeTransactions(); + +public: + LibraryBanking(); + ~LibraryBanking(); + LibraryBanking(const LibraryBanking& other); + LibraryBanking& operator=(const LibraryBanking& other); + LibraryBanking(LibraryBanking&& other); + LibraryBanking& operator=(LibraryBanking&& other); + + void RegisterClerk(const BankClerk& clerk); + BankClerk* LoginClerk(unsigned clerkNumber, unsigned dynamicPassword, const String& staticPassword); + + void ListPendingTransactions(); + Transaction* GetTransaction(unsigned index); + const Transaction* RegisterTransaction(const Transaction& transaction); + + void ExportNonPendingTransactions(const String& fileName); +}; + +#endif /* _LIBRARY_BANKING */ -- cgit v1.3.1-23-gd82d