Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Typing SVG
header

Live Demo License Made with C++

Status OOP Polymorphism Build Step



πŸͺž Overview

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 Account* pointer. When the monthly cycle runs, each account decides for itself, at runtime, whether to earn interest or pay a fee.

πŸ’¬ "One interface. Many behaviors. Resolved at runtime."

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  🏦 Bank        β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
           β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Account* ptr   β”‚
   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”˜
       β–Ό       β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚ Savings  β”‚ β”‚ Current  β”‚
 β”‚ Account  β”‚ β”‚ Account  β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”— Live Demo: ayeshajavid91-star.github.io/LedgerCore


✨ Feature Matrix

🎯 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

🧬 OOP Architecture β€” Class Hierarchy

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
Loading

πŸ”„ Runtime Polymorphism β€” How the Magic Happens

🏦 Savings Account πŸ’Ό Current Account
  • Earns monthly compound interest interest = balance Γ— (annualRate / 12)
  • Enforces a minimum balance on withdrawals
  • Rewards long-term saving behavior
  • Deducts a fixed fee per withdrawal
  • Charges a monthly maintenance fee
  • Built for frequent, transactional use
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
Loading

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.


πŸ› οΈ Tech Stack

C++ HTML5 CSS3 JavaScript

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

βš™οΈ How It Works

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.

▢️ Getting Started

πŸš€ Try it Instantly β€” No Installation

πŸ‘‰ Launch LedgerCore Web Demo πŸ‘ˆ

πŸ’» Run the C++ Console Version

# 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

πŸ–₯️ Console Menu

#Option
1Open New Account
2Deposit
3Withdraw
4View Account Details
5View Transaction History
6View All Accounts
7Run Monthly Cycle (Interest/Fee)
8Exit

🌐 Or Run the Web Version Locally

git clone https://github.com/ayeshajavid91-star/LedgerCore.git
cd LedgerCore

Then open index.html in your browser.


πŸ“‚ Project Structure

LedgerCore/
β”‚
β”œβ”€β”€ βš™οΈ  LedgerCore.cpp   β†’ C++ console application (core OOP engine)
β”œβ”€β”€ 🌐 index.html        β†’ Web version (browser demo)
└── πŸ“˜ README.md         β†’ You are here

🏷️ GitHub Topics

cpp oop banking-system polymorphism inheritance console-application


πŸ—ΊοΈ Roadmap

  • 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

πŸ‘€ Author

Ayesha Javid

Email GitHub


πŸ“„ License

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


🌟 If you like this project, consider giving it a star!

About

🏦 LedgerCore β€” an OOP-based banking system in C++ featuring Savings & Current accounts, runtime polymorphism, transaction history, and automated interest/fee cycles. πŸ“’πŸ’³

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages