# landy **Repository Path**: zhao2596989641/mini-banking-system ## Basic Information - **Project Name**: landy - **Description**: 2024-2025学年第二学期 C++个人作业 - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-26 - **Last Updated**: 2025-05-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🏦 Mini Banking System ## 📋 Basic Info **English Name🌟**: `Landy` **Chinese Name🌟**: `赵书炜 (Zhao Shuwei)` **ID🔢**: `2023902038` **Class🎓**: `class 1` --- ## 🗂️ Class Structure & Explanation ### 📁 Project Structure - 📁 mini-banking-system/ - 📂 code(code_en, code_zh)/ - 📂 include/ - 📝 Bank.hh - 📝 BankUtils.hh - 📝 Customer.hh - 📝 IAccount.hh - 📝 SavingsAccount.hh - 📝 CheckingAccount.hh - 📝 Transaction.hh - 📝 TransactionManager.hh - 📝 IO.hh - 📝 Utils.hh - 📝 main.hh - 📂 sources/ - 📜 Bank.cpp - 📜 BankUtils.cpp - 📜 Customer.cpp - 📜 SavingsAccount.cpp - 📜 CheckingAccount.cpp - 📜 Transaction.cpp - 📜 TransactionManager.cpp - 📜 IO.cpp - 📜 Utils.cpp - 📜 main.cpp - ⚙️ CMakeLists.txt - 📄 .gitignore - 📘 Classes_Documentation.md - 📔 update_logs.md - 📜 LICENSE - 📖 README.md --- ### 🗒️ Classes #### Utils (namespace) **Functionality**: 🔧 Provides utility functions for time, random number generation, ID generation, and file system operations. #### Bank **Functionality**: 🏦 Manages all customers and accounts, providing entry points for banking operations. #### BankSystem (namespace) **Functionality**: 🏦 Orchestrates the overall banking application flow and user interactions, connecting various components like Bank, Customer, and IO to manage the application's main menus and operations. #### BankUtils (namespace) **Functionality**: 💰 Handles core business logic for banking operations such as deposits, withdrawals, and transfers. #### IAccount (interface) **Functionality**: 💳 Defines common operations for all account types, providing methods for managing accounts including depositing, withdrawing, transferring funds, and viewing transaction history. #### CheckingAccount **Functionality**: 💵 Represents a checking account with support for deposits, withdrawals, and transfers. #### Customer **Functionality**: 👤 Represents a bank customer with personal information and associated bank accounts. #### IO (namespace) **Functionality**: 💻 Manages user interface interactions and input/output operations. #### SavingsAccount **Functionality**: 💰 Represents a savings account with restricted deposit and withdrawal operations. #### Transaction **Functionality**: 🔄 Represents a bank transaction record. #### TransactionManager **Functionality**: 🗄️ Manages transaction records, providing sorting and report generation capabilities. --- **Note**: For a more detailed description of the classes, please refer to the `Classes_Documentation.md` document. --- ## 🧩 Project Overview ### 1. 🏦 System Overview This is a simple banking account management system with the following features: - 👤 **Customer registration and management** - 💰 **Savings and checking account operations** - 🔄 **Transactions (deposit, withdrawal, transfer)** - 📊 **Transaction history and report generation** --- ### 2. ⚡ Quick Start #### 2.1 📋 Main Menu The system displays the main menu upon startup: ``` ===== Banking System ===== 1. Register new customer 2. Access customer account 3. Display all bank accounts 4. Generate transaction report 5. Exit ``` #### 2.2 🔄 Basic Workflow 1️⃣ Select `"1. Register new customer"` to create new accounts 2️⃣ Select `"2. Access customer account"` and enter customer name 3️⃣ Select account type (`savings` / `checking`) in customer interface 4️⃣ Choose operation (`deposit`, `withdraw`, `transfer`, etc.) --- ### 3. 🔍 Feature Details #### 3.1 👤 Customer Management - **Register new customer**: 🛠️ System automatically creates both savings and checking accounts - **Access customer account**: 🔐 Enter registered customer name #### 3.2 💳 Account Operations 📘 **Savings Account:** - ❌ No direct deposit (only through transfers) - ➡️ Can transfer to same customer's checking account - 🚫 No withdrawal allowed 💵 **Checking Account:** - ✅ Supports deposit and withdrawal - 🔄 Supports transfers to other accounts --- ### 4. ⚠️ Important Notes 1. 💳 Savings accounts start with `"21"`, checking accounts with `"22"` 2. 🎯 Full target account ID required for transfers 3. 💱 All amounts support up to `2 decimal places` 4. 🕒 System automatically records transaction details with timestamps --- ### 5. 🚪 Exiting System Select `"5. Exit"` from main menu, system will close automatically after **3 seconds**. > 💡 Tip: Press `Enter` to continue, system auto-clears screen for clean interface. --- ### ✅ Summary This system provides a clean, intuitive, and feature-rich simulation of basic banking operations — perfect for educational use or small-scale testing. --- ## 🛠️ Cross-Platform Compilation & Execution Guide ### 🔧 Compilation Steps (Universal) 1. Open terminal and navigate to project root directory ```bash # For English version cd ./codes_en # For Chinese version cd ./codes_zh ``` 2. Create build directory and generate build files: ```bash cmake -B build ``` > **Note**: If the command execution results in an error, please refer to the compilation methods for multiple platforms provided below. 3. Execute compilation: ```bash cmake --build build ``` --- ### 🌍 Platform-Specific Instructions #### 🪟 Windows Platform: ```bash # For MinGW cmake -G "MinGW Makefiles" -B build # For Visual Studio cmake -G "Visual Studio 17 2022" -B build ``` #### 🍏 macOS Platform: ```bash # Using Xcode toolchain cmake -G "Xcode" -B build # Or using Unix Makefiles cmake -B build -DCMAKE_BUILD_TYPE=Release ``` #### 🐧 Linux Platform: ```bash # First install development toolchain sudo apt-get install build-essential # Standard compilation cmake -B build -DCMAKE_BUILD_TYPE=Release ``` --- ### 💡 Additional Options * Specify compilers: `-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++` * Debug mode: `-DCMAKE_BUILD_TYPE=Debug` * Installation path: `-DCMAKE_INSTALL_PREFIX=/usr/local` --- ### 🏃 Executing the Program ```bash # Universal method (paths may vary) ./program # Linux/macOS .\program.exe # Windows ``` --- ### 📝 Important Notes 1. Ensure platform-specific development toolchains are installed 2. Before first compilation, verify: ```bash cmake --version # Check CMake version make --version # Check build tools ``` 3. If encountering issues, try deleting the build directory and regenerating 4. The folder still contains the pre-compiled program files based on the last code edits. You can run and use them directly. --- > **Note**: We provide both Chinese (./code_cn) and English (./code_en) versions, both are fully developed and ready for your experience.