Shahriah Based Bank Management System

🎯 System Overview

This Bank Management System is a comprehensive C program that manages bank accounts with features like account creation, transactions, and data management. Let's explore how each component works!

🏗️ Data Structures

The system uses structs to organize customer data efficiently:

📊 Customer Record Structure

struct date { int month, day, year; }; struct { char name[10000]; int acc_no, age; char address[60]; char citizenship[15]; double phone; char acc_type[10]; float amt; struct date dob; struct date deposit; struct date withdraw; } add, upd, check, rem, transaction;

Explanation: This struct stores all customer information including personal details, account information, and transaction dates.

🔄 System Flow

1. User Login with Password
2. Main Menu Display
3. User Selects Operation
4. System Executes Function
5. Return to Menu or Exit

📋 Main Menu System

💾 File Operations

The system uses file I/O to persist data:

📁 Data Storage

// File operations example FILE *ptr; ptr = fopen("record.dat", "a+"); // Append mode fprintf(ptr, "%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n", add.acc_no, add.name, add.dob.month, add.dob.day, add.dob.year, add.age, add.address, add.citizenship, add.phone, add.acc_type, add.amt, add.deposit.month, add.deposit.day, add.deposit.year);

How it works: Customer data is stored in a text file with space-separated values for easy retrieval.

🔍 Key Functions Explained

1. Account Creation (new_acc)

// Validates unique account number // Collects customer details // Stores in file

Creates new accounts with validation for duplicate account numbers.

2. Transaction Processing (transact)

// Handles deposits and withdrawals // Updates account balance // Prevents transactions on fixed deposits

Manages financial transactions with proper validation.

3. Account Management (edit/erase)

// Updates customer information // Deletes accounts safely // Maintains data integrity

Allows modification and deletion of account records.

4. Data Retrieval (see/view_list)

// Searches by account number or name // Displays customer details // Lists all accounts

Provides multiple ways to access and view account information.

🧮 Jakat Calculator

A special feature for Islamic banking:

// Jakat calculation logic if(add.amt >= 80000) { double jakat = (2.5/100) * add.amt; printf("Zakat amount: %.2f\n", jakat); }
How it works:
  • Checks if account balance exceeds 80,000 Taka
  • Calculates 2.5% of the total amount
  • Displays the zakat amount to be paid

🔐 Security Features

// Password protection char pass[10], password[10] = "LeadCoder"; if(strcmp(pass, password) == 0) { // Grant access menu(); } else { // Retry or exit }
Security measures:
  • Hard-coded password protection
  • Multiple retry attempts allowed
  • Clean exit on failure

⚡ Real-time Execution Flow

Here's how the system processes a typical transaction:

// Step 1: User selects transaction printf("Enter account no: "); scanf("%d", &transaction.acc_no); // Step 2: System searches account while(fscanf(ptr, "%d %s...", &add.acc_no, ...) != EOF) { if(add.acc_no == transaction.acc_no) { // Account found } } // Step 3: Process transaction if(choice == 1) { // Deposit add.amt += transaction.amt; } else { // Withdraw add.amt -= transaction.amt; }
Execution steps:
  1. User provides account number
  2. System searches through file records
  3. Validates account type (fixed deposits restricted)
  4. Updates balance and rewrites file
  5. Provides success/failure feedback

📂 View Source Code

Explore the complete C source code for this banking system on GitHub

View on GitHub