This C++ project simulates basic banking operations using object-oriented programming principles. It provides functionalities to manage bank accounts, perform transactions, and persist data using file handling.
- Account Management: Create savings or checking accounts with initial balances.
- Transaction Handling: Deposit funds, withdraw money, and transfer money between accounts.
- Data Persistence: Accounts are stored and retrieved from a text file (
accounts.txt
). - Error Handling: Manage errors such as insufficient balance or non-existent accounts gracefully.
- User Interface: Interactive console-based interface for user interaction.
- Account: Base class for generic bank account operations.
- SavingsAccount: Derived class with specific rules for savings accounts.
- CheckingAccount: Derived class with specific rules for checking accounts.
- Manages accounts using a
map<int, Account*>
. - Provides methods to add, delete, retrieve, and display accounts.
- Handles transactions such as deposit, withdrawal, and transfer.
- Transaction: Abstract base class defining common transaction methods.
- DepositTransaction: Implements deposit operation.
- WithdrawTransaction: Implements withdrawal operation.
- Transfer: Implements fund transfer between accounts.
- Accounts are serialized (
save_to_file()
) and deserialized (load_from_file()
) to maintain data persistence across sessions.
-
Clone the Repository:
git clone https://github.com/your-username/banking-system.git cd banking-system
-
Compile and Run:
- Compile the
main.cpp
file using your C++ compiler:g++ main.cpp -o banking_system
- Run the executable:
./banking_system
- Compile the
-
Interact with the Banking System:
- Follow the console prompts to create accounts, perform transactions, and manage accounts.
-
Data Persistence:
- Ensure
accounts.txt
is present in the same directory for saving and loading account data.
- Ensure
Contributions are welcome! If you have suggestions or improvements, please fork the repository and create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
### Explanation of Markdown Syntax Used:
- **Headings**: Created using `#` for main headings (`#`) and subheadings (`##`, `###`).
- **Lists**: Unordered lists (`-`) are used for listing features and components.
- **Code Blocks**: Enclosed in triple backticks (` ``` `) for commands and code snippets.
- **Links**: Enclosed in square brackets (`[]`) followed by the URL in parentheses (`()`).
- **Emphasis**: **Bold** text is created by enclosing it in double asterisks (`**`).
### Usage Notes:
- Replace `your-username` in the clone URL with your actual GitHub username or organization name.
- Ensure that the file paths (`accounts.txt`, `LICENSE`) are correctly specified according to your project structure.