A console-based Banking Management System developed in C++ as part of the CodeAlpha C++ Programming Internship — Task 3.
The application simulates essential banking operations including customer and account creation, deposits, withdrawals, fund transfers, account information, and recent transaction history. It also saves banking data to a local file so that customer and account information can be loaded again when the program starts.
The Banking Management System is an object-oriented C++ application designed to demonstrate the basic functionality of a banking environment.
The system allows users to:
- Create customers and their accounts
- Generate customer IDs and account numbers
- Deposit money
- Withdraw money
- Transfer funds between accounts
- View account details
- View recent transactions
- Display all registered customers
- Save banking data to a file
- Load previously saved banking data
The project combines Object-Oriented Programming, file handling, input validation, arrays, functions, and transaction management into one console application.
Internship: CodeAlpha C++ Programming Internship Task: Task 3 — Banking System Language: C++ Application Type: Console Application Storage: Local text file Platform: C++
The system allows new customers to be registered with:
- Customer name
- Phone number
- Automatically generated customer ID
- Automatically generated account number
Customer names are validated to allow letters and spaces only.
Phone numbers must contain exactly 11 digits, and duplicate phone numbers are rejected.
Each customer is assigned an account when the customer is created.
The system automatically generates:
Customer ID: 1001+
Account Number: 50001+
The next available IDs and account numbers are updated as new customers are created.
Users can deposit a positive amount into an existing account.
After a successful deposit, the system displays the updated balance and records the transaction as a Deposit.
The withdrawal system:
- Accepts a positive amount
- Checks the account balance
- Prevents withdrawals greater than the available balance
- Updates the account balance
- Records the withdrawal transaction
The user is shown the available balance if the requested withdrawal exceeds the account balance.
Money can be transferred between two different accounts.
The system checks:
- Sender account exists
- Receiver account exists
- Sender and receiver are different
- Transfer amount is positive
- Sender has sufficient balance
A successful transfer creates two transaction records:
Transfer Out → Sender
Transfer In → Receiver
The updated balances of both accounts are displayed after the transfer.
Every successful deposit, withdrawal, and transfer is recorded as a transaction.
The system stores:
- Transaction type
- Amount
- Transaction details
Unlike a temporary in-memory banking simulation, this implementation saves its data to:
bank_data.txt
Customer information, account information, balances, and transaction records are written to the file and loaded again when the application starts.
The project is built around four main classes:
BankingSystem
│
└── Customer
│
└── Account
│
└── Transaction
The Transaction class represents an individual banking transaction.
string type;
double amount;
string details;- Store transaction type
- Store transaction amount
- Store transaction details
- Display transaction information
The system uses transaction types such as:
Deposit
Withdraw
Transfer Out
Transfer In
The Account class manages an individual bank account.
- Account number
- Balance
- Transaction array
- Transaction count
Create Account
Deposit
Withdraw
Transfer
Display Account
Display Recent Transactions
Save Account Data
Load Account Data
The class supports up to 100 transactions per account.
The Customer class stores customer information and contains the customer's account.
Customer ID
Name
Phone Number
Account
Each customer object manages its associated account and can display the customer's information together with account details.
The BankingSystem class acts as the main controller of the application.
It manages:
- Customers
- Customer IDs
- Account numbers
- File storage
- Input validation
- Banking operations
- Application menu
The program supports up to 100 customers and uses bank_data.txt for data persistence.
The project defines the following limits:
| Item | Limit |
|---|---|
| Maximum Customers | 100 |
| Maximum Transactions per Account | 100 |
| Recent Transactions Displayed | 5 |
| Starting Customer ID | 1001 |
| Starting Account Number | 50001 |
When the application starts, users are presented with:
========================================
BANKING MANAGEMENT SYSTEM
========================================
1. Create Customer / Account
2. Deposit Money
3. Withdraw Money
4. Transfer Money
5. View Account Details
6. View Recent Transactions
7. Display All Customers
0. Exit
========================================
Enter choice:
START
│
▼
Load Saved Bank Data
│
▼
Main Menu
│
┌────────────┼────────────┐
▼ ▼ ▼
Create Deposit Withdraw
Customer Money Money
│ │ │
└────────────┼────────────┘
│
▼
Transfer Money
│
▼
View Account Details
│
▼
View Recent Transactions
│
▼
Display All Customers
│
▼
Save Data
│
▼
EXIT
Account Balance
+
Deposit Amount
=
New Balance
A successful deposit is recorded as:
Deposit | Amount | Cash deposit
Account Balance
-
Withdrawal Amount
=
Remaining Balance
The withdrawal is only completed when sufficient funds are available.
For a transfer between two accounts:
Sender Balance
-
Transfer Amount
↓
Receiver Balance
+
Transfer Amount
The system records both sides of the transaction:
Transfer Out
Transfer In
The application uses:
bank_data.txt
The BankingSystem class automatically loads saved information when the program starts and saves updated information after banking operations.
Data is saved when:
- A customer/account is created
- A deposit is completed
- A withdrawal is completed
- A transfer is completed
- The program exits
The file stores customer information, account details, balances, and transaction records.
The application includes validation for several types of user input.
Only letters and spaces are accepted.
The phone number must:
- Contain exactly 11 digits
- Contain digits only
- Not already belong to another customer
Deposit, withdrawal, and transfer amounts must be positive numbers.
The system verifies that the requested account exists before performing account operations.
The main menu accepts choices from:
0 – 7
C++
#include <iostream>
#include <fstream>
#include <string>
#include <limits>
#include <cctype>
#include <iomanip>- Object-Oriented Programming
- Classes and objects
- Encapsulation
- Constructors
- Member functions
- Arrays
- References
- File handling
- Data persistence
- Input validation
- String processing
- Loops
- Conditional statements
- Formatted output
- Transaction management
CodeAlpha_BankingSystem/
├── 1. Screenshot.jpg
├── 2. Screenshot.jpg
├── 3. Screenshot.jpg
├── 4. Screenshot.jpg
├── 5. Screenshot.jpg
├── 6. Screenshot.jpg
├── 7. Screenshot.jpg
├── 8. Screenshot.jpg
├── 9. Screenshot.jpg
├── README.md
└── main.cpp
bank_data.txtis generated/updated by the application to store banking information.
To run this project, you need:
-
A C++ compiler
-
C++17 or compatible C++ environment
-
Any C++ IDE or compiler such as:
- Visual Studio
- Code::Blocks
- Dev-C++
- MinGW/GCC
The program uses standard C++ libraries and does not require external frameworks.
git clone https://github.com/MairaAdil/CodeAlpha_BankingSystem.gitOpen the project in a C++ compatible IDE.
Compile main.cpp using your C++ compiler.
Start the application and select an option from the banking management menu.
The application will automatically load existing data from bank_data.txt if the file is available.
Enter customer name: Maira Adil
Enter phone number (11 digits): 03001234567
Customer created successfully!
Customer ID: 1001
Account Number: 50001
Enter account number: 50001
Enter deposit amount: 50000
Deposit successful!
New Balance: Rs. 50000.00
Enter account number: 50001
Enter withdrawal amount: 10000
Withdrawal successful!
Remaining Balance: Rs. 40000.00
Enter sender account number: 50001
Enter receiver account number: 50002
Enter transfer amount: 5000
Transfer successful!
The application displays recent transactions in a structured format:
Recent Transactions
---------------------------------------------
Type Amount Details
---------------------------------------------
Deposit 50000.00 Cash deposit
Withdraw 10000.00 Cash withdrawal
Transfer Out 5000.00 To account 50002
---------------------------------------------
The program displays a maximum of 5 recent transactions for an account.
Through this project, practical experience was gained in:
- Designing multiple interacting C++ classes
- Implementing customer and account management
- Building deposit and withdrawal functionality
- Implementing account-to-account transfers
- Maintaining transaction records
- Working with file input/output
- Creating persistent application data
- Validating user input
- Managing relationships between classes
- Building a complete console-based application
Possible improvements for a more advanced version include:
- Multiple accounts per customer
- Customer login and authentication
- PIN/password protection
- Account types such as savings and current accounts
- Interest calculation
- Account deletion and editing
- Transaction search and filtering
- Date and time for every transaction
- Bank statements
- Transaction export
- Database integration
- Improved data encryption
- Administrative controls
- Graphical user interface
- More flexible storage using
vectorand modern C++ containers
This project is an educational banking simulation developed for the CodeAlpha C++ Programming Internship.
It demonstrates core banking operations and local data persistence, but it is not intended to represent a real banking infrastructure.
It does not implement real-world banking security, financial regulations, external banking APIs, or production-grade database security.
Maira Adil
BS Artificial Intelligence Student University of Central Punjab
- LinkedIn: linkedin.com/in/mairaadil
- GitHub: github.com/MairaAdil
CodeAlpha C++ Programming Internship
This project was developed as part of the CodeAlpha internship to apply C++ concepts to a practical banking management application.
Special thanks to CodeAlpha for providing the opportunity to work on practical C++ programming tasks and strengthen software development skills through project-based learning.
⭐ If you find this project useful, consider giving the repository a star.