This project is a C++ console-based application that simulates a simple banking system.
It demonstrates the use of Object-Oriented Programming (OOP) principles including abstraction, inheritance, polymorphism, exception handling, and dynamic memory management.
The system allows users to create and manage savings accounts. It provides operations such as deposits, withdrawals, applying interest, and displaying account details.
All accounts are stored dynamically using std::vector, ensuring scalability and flexibility.
- Account Management
- Create a new savings account with a unique account number
- Display account details by account number
- Display all existing accounts
- Transactions
- Deposit money (validates positive input)
- Withdraw money (checks sufficient balance)
- Interest
- Apply fixed interest (5%) to all savings accounts
- Menu-Driven Interface
- User-friendly console menu with structured options
- Attributes
int accountNumberstd::string holderNamefloat balance
- Pure Virtual Methods
deposit(float)withdraw(float)displayDetails()applyInterest()
- Inherits from
Account - Additional Attribute
float interestRate = 0.05
- Overrides
- Implements deposit and withdraw with exception handling
- Defines
applyInterest()to increase balance by 5% - Custom
displayDetails()
- Uses
std::vector<Account*> accounts; - Enables storing multiple accounts dynamically with polymorphism.
- Polymorphism → base class pointers calling derived class methods
- Exception Handling → ensures robust input validation for deposits and withdrawals
- Validation Functions
checkIfAccountExists()→ prevents duplicate accountscheckIfAccountsEmpty()→ prevents invalid operations when no accounts exist
bank-account-management-system-cpp/
│
├── src/
│ └── BankSystem.cpp # Main source code
│
├── SystemDesign(UML-Style_Plan).pdf # System design diagram
│
└── README.md
Compile the program using g++:
g++ src/BankSystem.cpp -o BankSystem
./BankSystemWelcome to the Bank Account Management System
---------------------------------------------
1 -> Main Menu
2 -> Exit
*********** Main Menu ***********
1 -> Create New Account
2 -> Deposit
3 -> Withdraw
4 -> Display Details By Account Number
5 -> Display All Accounts
6 -> Apply Interest (for savings)
0 -> Opening Menu
- Language: C++ (C++11 standard and above)
- Data Structures:
std::vectorfor dynamic storage - Concepts Used: OOP (abstraction, inheritance, polymorphism), exception handling
- SystemDesign(UML-Style_Plan).pdf → High-level system design diagram
- Support for multiple account types (e.g., CheckingAccount, BusinessAccount)
- File I/O for saving and loading accounts
- Extended interest rate configurations
- More advanced error handling and input validation
This project is licensed under the MIT License.
See the LICENSE file for details.