BMS Report
BMS Report
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:
Utilizing hash tables and binary search trees for efficient account storage and
retrieval.
Source Code :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_ACCOUNTS 10
#define HASH_TABLE_SIZE 20
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];
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;
}
}
}
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 :
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.
10
References:
C Programming Language
Hash Tables