This C++ project implements a simple banking system. It allows users to perform various banking operations such as opening an account, checking balance, depositing, withdrawing, closing an account, and viewing all accounts. The project utilizes object-oriented programming principles and file handling for data persistence.
-
Open Account: Users can open a new bank account by providing their first name, last name, and initial balance.
-
Balance Enquiry: Users can check the balance of their account by providing the account number.
-
Deposit: Users can deposit a specified amount into their account.
-
Withdrawal: Users can withdraw a specified amount from their account, with a check for minimum balance.
-
Close Account: Users can close their account, which removes it from the system.
-
Show All Accounts: Displays details of all existing accounts.
The project consists of two main classes:
-
Account: Represents a bank account with attributes such as account number, first name, last name, and balance. It includes methods for deposit, withdrawal, and file I/O operations.
-
Bank: Manages a collection of accounts and provides methods for various banking operations. It reads and writes account data to a file for persistence.
- Compile the code using a C++ compiler.
g++ BankingSys.cpp -o BankingSys
- Run the executable.
./BankingSys
- Follow the on-screen menu to perform different banking operations.
Account data is stored in a file named "Bank.data". The data is read at the start of the program, and changes are written back to the file when the program exits.
The project uses exception handling for insufficient funds during withdrawals. It demonstrates the use of classes, file handling, and map container in C++.
Swapnil Pawar