|
LedgerCore is an Object-Oriented Banking System built entirely in C++, designed to demonstrate real-world software engineering principles β classes, inheritance, encapsulation, and true runtime polymorphism β through a practical, relatable domain: banking. Every account in LedgerCore is created as a specific type β Savings or Current β but managed uniformly through a base
|
|
π Live Demo: ayeshajavid91-star.github.io/LedgerCore
| π― Feature | π Description | βοΈ Implemented With |
|---|---|---|
| π§Ύ Account Creation | Open new customer accounts with unique auto-generated account numbers | Classes & Constructors |
| π° Deposit / Withdraw | Fund transfers with real-time balance validation | Encapsulated Methods |
| π Transaction History | Every deposit, withdrawal, and fee is logged per account | Vectors of Transaction Records |
| π¦ Central Bank Manager | A single Bank class owns and manages every account |
Pointers & Aggregation |
| π Runtime Polymorphism | Interest vs. fee logic resolved dynamically, per account, at runtime | Virtual Functions |
| π Monthly Cycle Engine | One function applies the correct operation across every account type | Abstract Base Class |
classDiagram
class Account {
<<abstract>>
#string accountNumber
#string ownerName
#double balance
#vector~Transaction~ history
+deposit(amount)
+withdraw(amount)
+applyMonthlyOperation()*
}
class SavingsAccount {
-double interestRate
-double minBalance
+applyMonthlyOperation()
+withdraw(amount)
}
class CurrentAccount {
-double withdrawalFee
-double maintenanceFee
+applyMonthlyOperation()
+withdraw(amount)
}
class Bank {
-vector~Account*~ accounts
+openAccount()
+runMonthlyCycle()
+findAccount(accountNumber)
}
Account <|-- SavingsAccount : inherits
Account <|-- CurrentAccount : inherits
Bank o-- Account : manages
| π¦ Savings Account | πΌ Current Account |
|---|---|
|
|
sequenceDiagram
participant Bank
participant Account as Account*
participant Savings as SavingsAccount
participant Current as CurrentAccount
Bank->>Account: runMonthlyCycle()
Account->>Savings: applyMonthlyOperation()
Savings-->>Account: + interest applied
Account->>Current: applyMonthlyOperation()
Current-->>Account: - fees deducted
Note over Account: Resolved dynamically at runtime<br/>via virtual dispatch
Because applyMonthlyOperation() is declared as a pure virtual function in Account, every derived class must supply its own implementation β and the correct version is chosen automatically at runtime, with zero if/else type-checking required. That's polymorphism doing exactly what it's meant to do.
| Layer | Technology | Purpose |
|---|---|---|
| βοΈ Core Logic | C++ β Classes, Inheritance, Virtual Functions, Abstract Classes, Pointers, Vectors | Console banking engine |
| π Web Version | HTML, CSS, JavaScript | Interactive browser demo of the same logic |
| Step | Description |
|---|---|
| 1 | Each account is created as a SavingsAccount or CurrentAccount object, but stored and managed through a common Account* pointer inside the Bank class. |
| 2 | When withdraw() or applyMonthlyOperation() is called on an account pointer, C++ determines at runtime which derived class's version to execute. |
| 3 | Savings accounts calculate interest as balance Γ (annualRate / 12), added monthly. |
| 4 | Current accounts deduct a fixed transaction fee per withdrawal plus a fixed monthly maintenance fee. |
π Launch LedgerCore Web Demo π
# 1οΈβ£ Clone the repository
git clone https://github.com/ayeshajavid91-star/LedgerCore.git
# 2οΈβ£ Move into the project folder
cd LedgerCore
# 3οΈβ£ Compile
g++ LedgerCore.cpp -o LedgerCore
# 4οΈβ£ Run
./LedgerCore| # | Option |
|---|---|
| 1 | Open New Account |
| 2 | Deposit |
| 3 | Withdraw |
| 4 | View Account Details |
| 5 | View Transaction History |
| 6 | View All Accounts |
| 7 | Run Monthly Cycle (Interest/Fee) |
| 8 | Exit |
git clone https://github.com/ayeshajavid91-star/LedgerCore.git
cd LedgerCoreThen open index.html in your browser.
LedgerCore/
β
βββ βοΈ LedgerCore.cpp β C++ console application (core OOP engine)
βββ π index.html β Web version (browser demo)
βββ π README.md β You are here
cpp oop banking-system polymorphism inheritance console-application
- Core account creation & management
- Deposit / withdraw with validation
- Transaction history tracking
- Runtime polymorphism (Savings vs. Current)
- Monthly cycle engine
- File-based persistence (save/load accounts)
- Admin dashboard for the web version
- Unit tests for interest & fee calculations
All Rights Reserved.
This project and its source code are the intellectual property of the author. No part of this repository β including the code, design, or documentation β may be copied, modified, distributed, used, or reproduced in any form without the explicit written permission of the author.
Β© 2026 Ayesha Javid. Unauthorized use is strictly prohibited.
For permissions or licensing inquiries, contact: ayeshajavid91@gmail.com
