# Cycurry **Repository Path**: cycurryyy/cycurry ## Basic Information - **Project Name**: Cycurry - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-24 - **Last Updated**: 2025-05-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🌟 Mini Banking System Requirements ## 🎯 Project Overview The **Mini Banking System** is a vibrant C++ console application crafted to emulate a streamlined banking experience. It champions **basic account management**, **dynamic transactions**, and **insightful reporting**. This project is a celebration of **object-oriented programming (OOP)** principles, **clean code artistry**, and **modern C++ flair**, delivering a robust and maintainable masterpiece. --- ## πŸ“‹ Producer Information Chinese Name:ι™ˆη¦Ήη› Chen yuchen English Name:Enzo Student ID:2023905940 Group:3 --- ## πŸš€ System Features Dive into a **menu-driven interface** bursting with these exciting options: 1. **πŸ†• Register new customer** 2. **πŸ”‘ Access customer accounts** 3. **πŸ“Š Display all bank accounts** 4. **πŸšͺ Exit** --- ### πŸ§‘β€πŸ’Ό Customer & Account Management #### 🌟 Customer Account Creation - **Input**: A dazzling customer name. - **Output**: - Conjures a **single checking account** for each customer. - Crafts a **unique account ID** in the format `62XX-YYYY-ZZZZ-AAAA`: - `62`: The iconic prefix. - `XX`: `22` for Checking. - `YYYY`: A random branch code. - `ZZZZ-AAAA`: A random account number. - Guarantees **uniqueness** of account IDs. - **Example**: ``` Enter customer name: Zhang Wei πŸŽ‰ Customer Zhang Wei successfully registered! Checking Account: 6222-XXXX-XXXX-XXXX ``` #### πŸ” Accessing a Customer Account - **Input**: Customer name. - **Output**: Unveils **checking account details** with these vibrant options: 1. **Access Checking Account** 2. **View all transactions** for this customer 3. **Return to main menu** - **Transaction View**: Presents all customer transactions in **chronological order** for easy tracking. #### 🏦 Accessing a Bank Account - **Display**: Showcases **account holder**, **balance**, and **account type**. - **Options**: 1. **πŸ’° Deposit** 2. **πŸ’Έ Withdraw** 3. **πŸ“œ View transaction history** 4. **πŸ”™ Return to customer page** - **Transaction History**: Lists all account transactions in **chronological order**. #### πŸ’Έ Transaction Operations - **Deposit**: - **Input**: Amount, optional note. - **Output**: Boosts the balance and logs a transaction with a **unique ID**. - **Withdraw**: - **Input**: Amount, optional note. - **Output**: Adjusts the balance and records a transaction with a **unique ID**. #### πŸ“ˆ Displaying All Bank Accounts - **Output**: - Highlights all **checking accounts** with: - **Account ID** - **Owner name** - **Balance** - Summarizes **total accounts**, **customers**, and **system-wide balance**. - **Example**: ``` 🌟 CHECKING ACCOUNTS: 1. ID: 6222-0001-8765-4321 | Owner: Zhang Wei | Balance: Β₯3200.00 2. ID: 6222-0002-4321-8765 | Owner: Li Mei | Balance: Β₯1800.75 Total Accounts: 2 Total Customers: 2 Total Balance: Β₯5000.75 ``` --- # 🌟 Mini Banking System Documentation ## 🎯 Project Overview The **Mini Banking System** is a vibrant C++ console application that brings a simplified banking experience to life! It supports **customer account creation**, **dynamic transactions** (deposit and withdraw), and **account reporting**. Crafted in **Visual Studio 2022**, this project shines with **object-oriented programming (OOP)** principles, **clean code artistry**, and **modern C++ features**, ensuring a robust and delightful user experience. --- ## πŸš€ How to Operate the System ### πŸ› οΈ Compilation & Execution - **🌍 Environment**: Fire up **Visual Studio 2022** (Version 17.12 or compatible). - **πŸ“„ Solution File**: Open `bank.sln` from the project root. - **βš™οΈ Configurations**: - Choose between **Debug** or **Release** modes. - Supports **x86 (Win32)** and **x64** platforms. - **πŸ—οΈ Build**: - Pick your configuration (e.g., `Debug|x64`) in Visual Studio. - Hit `Ctrl+Shift+B` to compile all source files. - **πŸš€ Run**: - Launch the program with `F5` or `Start Debugging`. - Watch the console light up with the main menu! ### πŸ“‹ User Interface The system boasts a **menu-driven console interface** that’s as intuitive as it is engaging: ``` 🌟 Mini Banking System 🌟 1. πŸ†• Register new customer 2. πŸ”‘ Access customer accounts 3. πŸ“Š Display all bank accounts 4. πŸšͺ Exit Please choose: ``` - **πŸ†• Register New Customer**: - Enter a customer’s name. - A **unique checking account** is created with an ID like `6222-YYYY-ZZZZ-AAAA`. - **πŸ”‘ Access Customer Accounts**: - Input a customer name to explore their checking account. - Options: **Access account**, **view transactions**, or **return to main menu**. - **πŸ“Š Display All Bank Accounts**: - Showcases all checking accounts with **IDs**, **owners**, and **balances**. - **πŸšͺ Exit**: Gracefully closes the application. ### πŸ’Έ Transaction Operations When diving into a checking account, you’ll find these exciting options: - **πŸ’° Deposit**: Add funds with an amount and optional note to boost the balance. - **πŸ’Έ Withdraw**: Deduct funds with an amount and optional note (if sufficient funds exist). - **πŸ“œ View Transaction History**: Displays all account transactions in **chronological order** for easy tracking. --- ## πŸ“‚ File Structure The project is organized like a well-kept vault, promoting **modularity** and **maintainability**: ``` MiniBankingSystem/ β”œβ”€β”€ πŸ“„ bank.sln # Visual Studio solution file β”œβ”€β”€ πŸ“ bank/ # Project directory β”‚ β”œβ”€β”€ πŸ“„ bank.vcxproj # Visual Studio project file β”‚ β”œβ”€β”€ πŸ“ include/ # Header files β”‚ β”‚ β”œβ”€β”€ πŸ“œ Account.h # Account class and interface β”‚ β”‚ β”œβ”€β”€ πŸ“œ CheckingAccount.h # CheckingAccount class β”‚ β”‚ β”œβ”€β”€ πŸ“œ Customer.h # Customer class β”‚ β”‚ β”œβ”€β”€ πŸ“œ Transaction.h # Transaction class β”‚ β”‚ β”œβ”€β”€ πŸ“œ Bank.h # Bank class (system management) β”‚ β”‚ └── πŸ“œ Utilities.h # Utility functions β”‚ β”œβ”€β”€ πŸ“ src/ # Source files β”‚ β”‚ β”œβ”€β”€ πŸ“œ main.cpp # Entry point and menu logic β”‚ β”‚ β”œβ”€β”€ πŸ“œ Account.cpp # Account class implementation β”‚ β”‚ β”œβ”€β”€ πŸ“œ CheckingAccount.cpp# CheckingAccount implementation β”‚ β”‚ β”œβ”€β”€ πŸ“œ Customer.cpp # Customer implementation β”‚ β”‚ β”œβ”€β”€ πŸ“œ Transaction.cpp # Transaction implementation β”‚ β”‚ β”œβ”€β”€ πŸ“œ Bank.cpp # Bank implementation β”‚ β”‚ └── πŸ“œ Utilities.cpp # Utility functions implementation └── πŸ“„ README.md # Project documentation ``` - **πŸ“„ bank.sln**: Defines project configurations (Debug/Release, x86/x64). - **πŸ“ bank/**: Houses the project file (`bank.vcxproj`) and source code. - **πŸ“ include/**: Stores **header files** for class interfaces and utilities. - **πŸ“ src/**: Contains **source files** with class and program logic. - **πŸ“„ README.md**: The heart of documentation, detailing setup, architecture, and classes. --- ## 🧩 C++ Classes & Their Roles The system is a symphony of **modular, object-oriented design**, powered by these classes: ### 1. 🌐 `Account` (Abstract Base Class) - **Purpose**: The blueprint for all account types. - **Attributes**: - `accountID`: Unique identifier (e.g., `6222-YYYY-ZZZZ-AAAA`) (string). - `balance`: Current balance (double). - `owner`: Account owner’s name (string). - **Methods**: - `virtual void deposit(double amount, const std::string& note) = 0`: Pure virtual for deposits. - `virtual void withdraw(double amount, const std::string& note) = 0`: Pure virtual for withdrawals. - `virtual std::vector getTransactions() const = 0`: Retrieves transaction history. - `std::string getAccountID() const`: Gets the account ID. - `double getBalance() const`: Gets the current balance. - **Role**: Ensures all account types follow a unified interface. ### 2. 🏦 `CheckingAccount` (Derived Class) - **Purpose**: Powers checking accounts with deposit and withdraw features. - **Inherits**: `Account`. - **Attributes**: - `transactions`: Vector of `Transaction` objects for history. - **Methods**: - `void deposit(double amount, const std::string& note)`: Adds funds and logs a transaction. - `void withdraw(double amount, const std::string& note)`: Deducts funds (if sufficient) and logs a transaction. - `std::vector getTransactions() const`: Returns transaction history. - **Role**: Manages checking account operations and transaction records. ### 3. πŸ§‘ `Customer` - **Purpose**: Represents a bank customer and their account. - **Attributes**: - `name`: Customer’s full name (string). - `checkingAccount`: Pointer to a `CheckingAccount` object. - **Methods**: - `std::string getName() const`: Returns the customer’s name. - `CheckingAccount* getCheckingAccount() const`: Returns the checking account. - `std::vector getAllTransactions() const`: Fetches all transactions from the checking account. - **Role**: Connects customers to their accounts and facilitates operations. ### 4. πŸ“ `Transaction` - **Purpose**: Captures details of a single transaction. - **Attributes**: - `transactionID`: Unique ID (e.g., `T001`) (string). - `type`: Transaction type (e.g., "Deposit", "Withdraw") (string). - `amount`: Transaction amount (double). - `note`: Optional description (string). - `timestamp`: Date and time (e.g., `YYYY-MM-DD HH:MM:SS`) (string). - **Methods**: - `std::string getDetails() const`: Returns formatted transaction details. - **Role**: Stores and displays transaction data for history and reporting. ### 5. πŸ›οΈ `Bank` - **Purpose**: Orchestrates the entire banking system. - **Attributes**: - `customers`: Vector of `Customer` objects. - **Methods**: - `void addCustomer(const std::string& name)`: Adds a new customer with a checking account. - `Customer* findCustomer(const std::string& name)`: Finds a customer by name. - `std::vector getAllCustomers() const`: Returns all customers. - `std::string generateAccountID()`: Creates a unique account ID. - **Role**: Manages customers, accounts, and ensures unique IDs. ### 6. πŸ› οΈ `Utilities` (Static Class) - **Purpose**: Provides handy helper functions. - **Methods**: - `static std::string generateRandomID(const std::string& prefix)`: Generates a random account ID. - `static std::string getCurrentTimestamp()`: Returns the current date and time. - `static void clearScreen()`: Clears the console for a polished UI. - `static void pause()`: Pauses until the user presses Enter. - **Role**: Enhances system functionality with reusable utilities. --- ## πŸ›οΈ Architecture Overview The system is built on a **modular, object-oriented foundation**: - **🌐 Abstract Interface (`Account`)**: Guarantees consistent account behavior. - **🌿 Inheritance (`CheckingAccount`)**: Extends `Account` for checking account specifics. - **πŸ”’ Encapsulation**: Private data (e.g., `balance`, `transactions`) is accessed via public methods. - **🎯 Single Responsibility**: - `Bank`: Oversees customers and system state. - `Customer`: Links customers to accounts. - `CheckingAccount`: Manages account operations. - `Transaction`: Handles transaction data. - `Utilities`: Offers reusable tools. - **πŸ“š Namespaces**: Classes reside in a `banking` namespace to prevent naming conflicts. - **πŸ“‚ File Organization**: Headers define interfaces, sources implement logic, ensuring clean separation. --- ## πŸ”‘ Key Design Decisions - **🏦 Single Account Type**: Focused on checking accounts to streamline core functionality. - **🌐 Abstract Base Class**: `Account` enables future extensibility (e.g., savings accounts). - **πŸ“ Transaction Simplicity**: In-memory transactions reduce complexity while meeting display needs. - **πŸ”’ Unique ID Generation**: Random IDs with a `6222` prefix mimic real-world banking formats. - **πŸ–₯️ Console UI**: `clearScreen` and `pause` create a clean, user-friendly experience. - **⚑️ Modern C++**: Uses `std::vector`, `std::string`, and smart pointers for robust memory management. --- ## πŸ“ Notes - The system operates **in-memory**; transactions are not saved to files unless extended. - `bank.sln` supports **x86/x64**, offering flexibility across environments. - The code embraces **clean code principles** with meaningful names, consistent formatting, and minimal duplication.