0% found this document useful (0 votes)
26 views

Assignment 03

This document outlines an assignment to build a banking system using a binary search tree (BST). Students are instructed to code functions for insertion, deletion, funds transfer, deposit, withdrawal, transaction history, searching, and query handling. The assignment requires generating 1000 random accounts to populate the BST, storing account details in arrays, and building a menu interface. Strict deadlines and policies against plagiarism are enforced.

Uploaded by

haseeb mudassar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Assignment 03

This document outlines an assignment to build a banking system using a binary search tree (BST). Students are instructed to code functions for insertion, deletion, funds transfer, deposit, withdrawal, transaction history, searching, and query handling. The assignment requires generating 1000 random accounts to populate the BST, storing account details in arrays, and building a menu interface. Strict deadlines and policies against plagiarism are enforced.

Uploaded by

haseeb mudassar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Data Structures and Analysis (BSCS-V(4-5-8), Fall-2022)

Assignment 03: Banking System Using BST


Deadline: Jan 8 (11:30 pm)
No late submissions will be accepted, so start earlier.

Instructions
Your assignment should represent your own effort. Each student shall write down and submit
his/her solutions separately.

For a programming task, your solution must contain (i) an explanation of your solution to the
problem (ii) the C++ code, in a form that we can run it, and (iii) instructions on how to run it.

For all programming tasks, it is not allowed to use any external libraries if not stated
otherwise. Please, include your name, student ID, and email address in your
submission.
Plagiarism will lead to -100% marks or ‘F’ Grade (any type of code sharing/Coping is
not allowed).

Submissions after Jan 8 (11:30 pm) will get zero. Any discussion/excuses regarding
deadlines will lead to -50% marks. This time, we will not extend the deadline in any case.
So, start this assignment from day 1.

In this assignment, you are required to store the bank users’ details.

You are required to code the following functions

1) Insertion [log(n) times]


2) Deletion [log(n) times]
3) Funds-Transfer from one account to another account [log(n) times]
4) Deposit [log(n) times]
5) Withdraw [log(n) times]
6) History [of last 5 transactions]
7) Searching [log(n) times]
8) Query Handling:
a. Print the record of all the accounts of any branch [branch is encoded in the first
3 letters]
b. Print the records of all male accounts [4th digit is used for gender, 0-4 Male, 5-
9]
c. Print the records of all the male accounts of a specific branch
d. Print all the records of salary accounts
e. Etc.

You are required to create a menu page to execute the system’s functionality.

Account Number Pattern


All the accounts will be encoded in the form of digits [0-9]. The first three digits will present
the branch code. The fourth digit will present the gender (0-4 digits will be used for males and
5-9 will be used for females). The fifth digit will present the account type (0-Current, 1-
Saving, 2-Salary, 3-Education, 4-IT, 5-Government, 6-Bonds, 7-Foreign, 8-Agriculture, 9-
Ehsas). The last four digits will be used for the account number of a specific person.
Example Account: 001234567
• Branch: 001
• Gender: Male [4th digit is 2]
• Account Type: Education [3]
• Account Number: 4567

Restrictions: You are only allowed to use Arrays to store the account number.

Data Storage:
• Account Number
• Account Title
• Transaction History
• Balance
• Account Type
• Gender
Data:
You are required to generate 1000 nodes randomly. You have to write a function that will
generate random account details (such as account number, account title, and account balance).
The type of the account and gender can be extracted from the randomly generated account
number, as we know that the 4th digit represents the gender while the 5th digit represents the
account type. This function will call the Insert_Node function for every account. Insert_Node
function will detect the right position on the basis of the account number (that will be stored in
the array) and then insert the node in the BST.

The function described above (function to generate random data) should be called
immediately when the program started. After then the menu page should be open that allows
the user to perform all the functions mentioned at the start.

Please feel free to contact me (by email or visit my office during visiting hours). In case of
any confusion, you can discuss it with your fellows, but sharing code is strictly not allowed.
Your solution must be space-efficient along with time efficient.
Best of Luck

You might also like