# Rayne **Repository Path**: rayne-gao/rayne ## Basic Information - **Project Name**: Rayne - **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-26 - **Last Updated**: 2025-05-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Rayne Introduction Bank System Project README Project Overview This project implements a simple banking system that includes customer management, account operations, and transaction recording functionality. The system adopts an object-oriented design, implemented in C++, and consists of the following core components: Class Overview 1. Customer (Customer Class) • Responsibility: Represents bank customers • Key Attributes : • `name`: Customer name • Main Methods : • `getName()`: Gets the customer's name • `displayInfo()`: Displays customer information 1. Account (Abstract Account Class) • Responsibility: Base class for all account types, defining a unified interface • Key Attributes : • `accountID`: Unique account identifier • `balance`: Account balance • `owner`: Pointer to the account owner • Main Methods : • Pure virtual functions for deposit/withdrawal/transfer • `displayAccountInfo()`: Displays account information • `getAccountType()`: Gets the account type 1. SavingsAccount (Savings Account Class) • Inherits From: Account • Features: Implements savings account-specific logic • Account Type: Returns "Savings Account" 1. CheckingAccount (Checking Account Class) • Inherits From: Account • Features: Implements checking account-specific logic • Account Type: Returns "Checking Account" 1. Transaction (Transaction Record Class) • Responsibility: Records all financial transactions • Key Attributes : • `transactionID`: Unique transaction ID • `timestamp`: Transaction timestamp • `type`: Transaction type (Deposit/Withdrawal/Transfer) • `amount`: Transaction amount • `note`: Transaction notes 1. BankSystem (Bank System Class) • Responsibility: Core of the system, managing all customers, accounts, and transactions • Key Attributes : • `customers`: Collection of customers • `accounts`: Collection of accounts • `transactions`: Collection of transaction records • Main Functions : • Customer registration • Account management (creation/query) • Financial operations (deposit/withdrawal/transfer) • Report generation Overall Architecture ``` BankSystem ├── Manages multiple Customers │ └── Each Customer can own multiple Accounts │ ├── SavingsAccount │ └── CheckingAccount └── Records all Transactions ``` The system adopts a layered architecture: 1. Data Layer: Customer, Account and its subclasses, Transaction 2. Business Logic Layer: BankSystem provides all core functionalities 3. Presentation Layer: Simple console output via display methods Key Design Decisions 1. Polymorphic Account Design: • Uses an abstract base class (Account) to define a unified interface • Implements different account types via SavingsAccount and CheckingAccount • Facilitates future extension of new account types 2. Ownership Management: • Uses raw pointers to represent relationships between Customer and Account • BankSystem is responsible for managing the lifecycle of all objects • Simple default copy/destructor behavior, suitable for small systems 3. Transaction Recording System: • Independent Transaction structure records all financial operations • Contains complete contextual information for auditing • Supports multiple query methods (by account/by customer) 4. ID Generation Strategy: • Uses random numbers to generate unique account IDs • Uses a set to ensure ID uniqueness • Prefixes distinguish account types (e.g., savings/checking) 5. Reporting Functionality: • Supports account-level, customer-level, and global reports • Outputs to specified files • Reserves interfaces for future GUI integration Usage Instructions 1. Create a BankSystem instance 2. Use registerCustomer to register customers 3. Create accounts (savings/checking) via BankSystem 4. Perform deposit, withdrawal, and transfer operations 5. Query account information or generate reports at any time Personal Information Rayne Gao (高海天) ID: 2023903116 g++ -I../include account.cpp banksystem.cpp checkingaccount.cpp customer.cpp main.cpp savingsaccount.cpp transaction.cpp -o program