Skip to content

git-asadawan/console-bank.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

🏦 IBL Console Banking System

A beginner-friendly, console-based Bank Management System written in C++. Built around a fictional Islamic Bank Limited (IBL), this project demonstrates core Object-Oriented Programming concepts in a clean, interactive terminal interface — perfect for students and beginners looking for a solid C++ portfolio project.

✨ Features at a Glance

Feature Details
🔐 Sign-Up & Login Register with your name and a custom 4-digit PIN
🆔 Auto Account Number Unique IBL-XXXX-XXXX ID generated automatically on account creation
🔄 Smart Menu Option 1 automatically switches from "Add Account Details""Update Customer Information" after first setup
💳 Transaction Area Deposit and withdraw funds with real-time balance updates
🛡️ PIN Verification Required before any update or transaction — keeps your account secure
✅ Input Validation Enforces correct CNIC (13 digits), phone (10 digits), PIN (4 digits), and name length
🖥️ Clean Interface Centered headers, formatted sections, and smooth animated loading dots
🚪 Logout & Re-Login Logout returns you to the login screen without closing the app

🖥️ Program Flow

Launch App
    │
    ▼
[ Account Registration ]
  • Enter your name (min. 5 characters)
  • Create a 4-digit PIN
    │
    ▼
[ Login ]
  • Enter registered name + PIN
    │
    ▼
[ Dashboard ]
  ├─ [1] Add Account Details        ← First time
  │   └─ Auto-switches to →
  │  [1] Update Customer Information ← After account is created (PIN required)
  ├─ [2] Display Customer Details
  ├─ [3] Transaction Operations      ← PIN required
  │       ├─ Deposit
  │       └─ Withdraw (balance-checked)
  ├─ [4] Logout
  └─ [5] Exit Application

🔑 Key Functions Explained

🆔 generateAccountNumber()

Automatically creates a unique account number in the format IBL-XXXX-XXXX using random digits seeded from system time. No two sessions will produce the same number — no manual input required from the user.

🔄 Smart Option 1 — Auto-Switching Menu

When you first log in, Option 1 reads "Add Account Details". Once you fill in your information (name, CNIC, phone number), the system saves a flag internally. From that point forward, Option 1 permanently switches to "Update Customer Information" — and requires your PIN before allowing any changes.

🛡️ PIN-Protected Actions

Both the Update and Transaction sections require the user to enter their 4-digit PIN before proceeding. Incorrect PIN entries loop until the correct one is entered — no lockout, but no bypass either.

💸 transactionArea()

Handles both deposits and withdrawals:

  • Deposit — adds any entered amount to the balance.
  • Withdraw — validates that the requested amount does not exceed the current balance. Prompts again if the user tries to overdraw.

✅ Input Validators

Three dedicated validators keep bad data out:

  • isValidCNIC() — exactly 13 numeric digits
  • isValidPhone() — exactly 10 numeric digits
  • isValidPIN() — exactly 4 numeric digits

🖨️ printHeader()

Dynamically centers both the bank name (Islamic Bank Limited) and any section subtitle under a matching separator line — keeping the interface symmetrical regardless of the title length.

⏳ Animated Loading

Deposit and withdrawal processing, account creation, and login each display an animated Please wait... sequence using Sleep() — giving the program a polished, real-world feel.


🚀 Getting Started

Requirements

  • Windows OS (uses <windows.h>, <conio.h>, and system("CLS"))
  • Any C++ compiler: MinGW, MSVC (Visual Studio), or Dev-C++

Compile & Run

Using g++ (MinGW):

g++ bank-management.cpp -o bank -std=c++17
./bank

Using Dev-C++: Open the .cpp file → click Compile & Run (F11).

Using Visual Studio: Create a new empty C++ project → add the .cpp file → build and run.


📂 File Structure

IBL-Console-Banking/
└── bank-management.cpp    # Single-file program — everything in one place

🧠 Concepts Demonstrated

  • Object-Oriented Programming (Classes, structs, encapsulation)
  • Input validation and buffer management (cin.ignore)
  • Random number generation (rand, srand, time)
  • Control flow with switch, loops, and flags
  • String manipulation
  • Console UI formatting and screen clearing

⚠️ Platform Note

This project is Windows-only due to its use of:

  • <conio.h> — for getch() (no-Enter keypress reading)
  • <windows.h> — for Sleep() (loading animations)
  • system("CLS") — for clearing the console screen

Cross-platform support is a potential future improvement.


🌱 Ideal For

  • CS/IT students submitting semester projects
  • Beginners learning C++ OOP through a practical example
  • Anyone wanting a simple, readable banking simulation to study or extend

📄 License

This project is open source and free to use for educational purposes.


Made with ❤️ in C++ — Islamic Bank Limited Console System

About

A beginner-friendly console-based Bank Management System in C++. Features auto-generated account IDs, PIN-protected transactions, input validation, a smart adaptive menu, and a clean terminal interface. Great for CS students and OOP learners.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages