0% found this document useful (0 votes)
73 views12 pages

BMS Report

The document describes a project to develop a basic banking system management program using C. It implements functions for creating accounts, depositing, withdrawing, searching by name, and displaying all accounts using hash tables and binary search trees. The source code and functions like createAccount(), deposit(), withdraw() are discussed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views12 pages

BMS Report

The document describes a project to develop a basic banking system management program using C. It implements functions for creating accounts, depositing, withdrawing, searching by name, and displaying all accounts using hash tables and binary search trees. The source code and functions like createAccount(), deposit(), withdraw() are discussed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Project Report: Banking System Management.

Project submitted to the

SRM University – AP, Andhra Pradesh

for the partial fulfillment of the requirements to award the degree of

Bachelor of Technology/Master of Technology


In
Computer Science and Engineering
School of Engineering and Sciences

Submitted by
Saksham Saini , Rahul , Jaswanth , Abhishak , Pranavi
(AP22110010136)( AP22110010191)( AP22110010192)( AP22110011509)( AP221100101)

SRM University–AP
Neerukonda, Mangalagiri, Guntur
Andhra Pradesh – 522 240
Certificate
Date: 28-Nov-22

This is to certify that the work present in this Project entitled “BANKING
SYSTEM MANAGMENT” has been carried out by Saksham Saini,
Rahul, Jaswant , Pranavi , Abhishak under my/our supervision. The
work is genuine, original, and suitable for submission to the SRM
University – AP for the award of Bachelor of Technology/Master of
Technology in School of Engineering and Sciences.

Supervisor

(Signature)
Prof. / Dr. [Name]
Designation,
Affiliation.
Table of Contents
 Certificate .................................................................................... i
 Objective ................................................................................... iii
 Source Code .............................................................................. v
 Outputs .................................................................................... vii
 Conclusion ................................................................................ ix
 Strength ..................................................................................... xi
 Reffrence .................................................................................. xv

2
Objectives:
The objective of this project was to develop a basic banking system management
program using C. The primary goals included:

 Implementing a system to create, manage, deposit, withdraw, and display


bank accounts.

 Utilizing hash tables and binary search trees for efficient account storage and
retrieval.

 Providing a user-friendly interface for interacting with banking operations.

Source Code :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_ACCOUNTS 10
#define HASH_TABLE_SIZE 20

// Structure for a bank account


struct BankAccount {
char accountNumber[20];
char name[100];
float balance;
};

// Structure for a node in a binary search tree (BST)


struct BSTNode {
struct BankAccount account;
struct BSTNode* left;
struct BSTNode* right;
};

// Structure for the hash table


struct HashTable {
struct BSTNode* table[HASH_TABLE_SIZE];
};

// Function to initialize the hash table


struct HashTable* initializeHashTable() {
struct HashTable* hashTable = (struct HashTable*)malloc(sizeof(struct
HashTable));
for (int i = 0; i < HASH_TABLE_SIZE; ++i) {
hashTable->table[i] = NULL;
}
return hashTable;
}

// Function to hash the account number


int hashFunction(char accountNumber[]) {
int sum = 0;
for (int i = 0; accountNumber[i] != '\0'; ++i) {
sum += accountNumber[i];
}
return sum % HASH_TABLE_SIZE;
}

// Function to insert a bank account into the hash table


void insertIntoHashTable(struct HashTable* hashTable, struct BankAccount acc)
{
int index = hashFunction(acc.accountNumber);
struct BSTNode* newNode = (struct BSTNode*)malloc(sizeof(struct BSTNode));
newNode->account = acc;
newNode->left = NULL;
newNode->right = NULL;

if (hashTable->table[index] == NULL) {
hashTable->table[index] = newNode;
} else {
struct BSTNode* temp = hashTable->table[index];
while (temp->right != NULL) {
temp = temp->right;
}
temp->right = newNode;
}
}

// Function to search for a bank account by account number in the hash table
struct BSTNode* searchHashTable(struct HashTable* hashTable, char accNum[]) {
int index = hashFunction(accNum);
struct BSTNode* temp = hashTable->table[index];

while (temp != NULL) {


if (strcmp(temp->account.accountNumber, accNum) == 0) {
return temp;
}
temp = temp->right;
}
return NULL; // Account not found
}

4
// Function to display all accounts in the BST
void displayBSTAccounts(struct BSTNode* root) {
if (root != NULL) {
displayBSTAccounts(root->left);
printf("Account Number: %s, Holder's Name: %s, Balance: %.2f\n",
root->account.accountNumber, root->account.name, root-
>account.balance);
displayBSTAccounts(root->right);
}
}

// Function to display all accounts in the hash table (including BST accounts)
void displayAllAccounts(struct HashTable* hashTable) {
printf("\nAll Accounts:\n");
for (int i = 0; i < HASH_TABLE_SIZE; ++i) {
struct BSTNode* temp = hashTable->table[i];
while (temp != NULL) {
printf("Account Number: %s, Holder's Name: %s, Balance: %.2f\n",
temp->account.accountNumber, temp->account.name, temp-
>account.balance);
displayBSTAccounts(temp->left);
temp = temp->right;
}
}
}

// Function to search for accounts by account holder's name


void searchByName(struct HashTable* hashTable, char name[]) {
printf("\nAccounts with Holder's Name '%s':\n", name);
int found = 0;
for (int i = 0; i < HASH_TABLE_SIZE; ++i) {
struct BSTNode* temp = hashTable->table[i];
while (temp != NULL) {
if (strcmp(temp->account.name, name) == 0) {
printf("Account Number: %s, Holder's Name: %s, Balance:
%.2f\n",
temp->account.accountNumber, temp->account.name, temp-
>account.balance);
found = 1;
}
temp = temp->right;
}
}
if (!found) {
printf("No accounts found with this name.\n");
}
}
// Function to create a new bank account
struct BankAccount createAccount() {
struct BankAccount acc;
printf("Enter account number: ");
scanf("%s", acc.accountNumber);
printf("Enter account holder's name: ");
scanf("%s", acc.name);
printf("Enter initial balance: ");
scanf("%f", &acc.balance);
return acc;
}

// Function to deposit money into an account


void deposit(struct BankAccount *acc, float amount) {
acc->balance += amount;
printf("Amount %.2f deposited successfully.\n", amount);
}

// Function to withdraw money from an account


void withdraw(struct BankAccount *acc, float amount) {
if (amount <= acc->balance) {
acc->balance -= amount;
printf("Amount %.2f withdrawn successfully.\n", amount);
} else {
printf("Insufficient balance.\n");
}
}

// Function to check account balance


void checkBalance(struct BankAccount acc) {
printf("Account Number: %s\n", acc.accountNumber);
printf("Account Holder Name: %s\n", acc.name);
printf("Current Balance: %.2f\n", acc.balance);
}

int main() {
struct HashTable* hashTable = initializeHashTable();
int numAccounts = 0;
int choice;
printf("*****************************************\n");
printf("* *\n");
printf("* WELCOME TO BANKING SYSTEM *\n");
printf("* *\n");
printf("*****************************************\n");

while (1) {
printf("\nBank Account Management System\n");

6
printf("1. Create Account\n");
printf("2. Deposit\n");
printf("3. Withdraw\n");
printf("4. Check Balance\n");
printf("5. Search Account by Name\n");
printf("6. Display All Accounts\n");
printf("7. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);

switch (choice) {
case 1:
if (numAccounts < MAX_ACCOUNTS) {
struct BankAccount newAcc = createAccount();
insertIntoHashTable(hashTable, newAcc);
numAccounts++;
} else {
printf("Maximum accounts limit reached.\n");
}
break;
case 2: {
char accNum[20];
float amount;
printf("Enter account number: ");
scanf("%s", accNum);
struct BSTNode* accNode = searchHashTable(hashTable, accNum);
if (accNode != NULL) {
printf("Enter amount to deposit: ");
scanf("%f", &amount);
deposit(&(accNode->account), amount);
} else {
printf("Account not found.\n");
}
break;
}
case 3: {
char accNum[20];
float amount;
printf("Enter account number: ");
scanf("%s", accNum);
struct BSTNode* accNode = searchHashTable(hashTable, accNum);
if (accNode != NULL) {
printf("Enter amount to withdraw: ");
scanf("%f", &amount);
withdraw(&(accNode->account), amount);
} else {
printf("Account not found.\n");
}
break;
}
case 4: {
char accNum[20];
printf("Enter account number: ");
scanf("%s", accNum);
struct BSTNode* accNode = searchHashTable(hashTable, accNum);
if (accNode != NULL) {
checkBalance(accNode->account);
} else {
printf("Account not found.\n");
}
break;
}
case 5: {
char searchName[100];
printf("Enter account holder's name to search: ");
scanf("%s", searchName);
searchByName(hashTable, searchName);
break;
}
case 6:
displayAllAccounts(hashTable);
break;
case 7:
printf("Exiting...\n");
exit(0);
default:
printf("Invalid choice. Please enter a valid option.\n");
}
}

return 0;
}

8
OUTPUTS :

1. Start of the Program:

2. Creating new accounts by entering account Details:

3. Depositing and withdrawing amounts from existing accounts.


4. Checking account balances.

5. Searching accounts by holder's name.

6. Displaying all accounts stored in the system.

Conclusion:
The completed project achieved the objectives set forth for a basic banking system
management program. It successfully utilized hash tables and binary search trees to
organize and manage bank accounts efficiently. The program demonstrated
functionalities for account creation, transaction handling, and account
retrieval/searching.

Strengths:
 Utilized data structures (hash tables, BST) effectively for account
management.

 Provided essential banking operations in a user-friendly manner.

10
References:
 C Programming Language

 Hash Tables

 Binary Search Trees

You might also like