Skip to content

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.

Notifications You must be signed in to change notification settings

tejasrocksHere/Banking-Systems-C-

Repository files navigation

Banking System in C++

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.

Features

  • 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.
  • image

Classes and Components

Account Class Hierarchy

  • 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.

Bank Class

  • 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 Classes

  • Transaction: Abstract base class defining common transaction methods.
  • DepositTransaction: Implements deposit operation.
  • WithdrawTransaction: Implements withdrawal operation.
  • Transfer: Implements fund transfer between accounts.

File Handling

  • Accounts are serialized (save_to_file()) and deserialized (load_from_file()) to maintain data persistence across sessions.

Usage

  1. Clone the Repository:

    git clone https://github.com/your-username/banking-system.git
    cd banking-system
  2. Compile and Run:

    • Compile the main.cpp file using your C++ compiler:
      g++ main.cpp -o banking_system
    • Run the executable:
      ./banking_system
  3. Interact with the Banking System:

    • Follow the console prompts to create accounts, perform transactions, and manage accounts.
  4. Data Persistence:

    • Ensure accounts.txt is present in the same directory for saving and loading account data.

Contributing

Contributions are welcome! If you have suggestions or improvements, please fork the repository and create a pull request.

License

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.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages