A c program demonstrating a tiny bank
It’s a project I’m supposed to do i need help and I’ve got a template which could be followed :
This is the question:
Description
Code:
You are supposed to implement a simple software that models an exaggeratedly small bank and its
simple transactions and operations. The bank can keep track of some customers account in a
database file.
A customer is modeled by the following items: Customer Number (random 4 digit number given by the system at the time of creating) Customer Full Name (string with max length 20) Customer Date of Birth
o It has Day, Month, Year (each one is an integer) Customer Address (string with max length 100) Customer Telephone number (string with max length 20) Customer Balance (a double number) Tellers are modeled as follows:
Teller’s Full Name (string with max length 20) Teller’s User Name (string with max length 10) Teller’s Password (string with max length 10)
The information about Customers and Tellers are kept into two separated files customers.txt and
tellers.txt. An example of tellers.txt file is given bellow:
Albert Einstein, albert1879, qazedc789456
Jim Carrey, jimjim, 123mnbvcxz
…
An example of customers.txt file is given below:
9654, Bill Gates, 28/10/1955, {1835 73rd Ave NE Medina WA 98039 Zillow}, +14258828080, 91000000000.00
1151, Shahin Mehdipour Ataee, 1/1/1983, {C2, Riverside, Catalkoy, Girne}, +905331234567, 500.00
…
The system works as below:
After running the program, the system asks the user to login. A teller should enter his/her username
and password to be able to log into the system. The system asks at most 3 times from the teller to
enter correct username and password after, the 3
rd unsuccessful try it stops asking and terminates.
After successful logging in, the system shows a welcome message to the teller (exp. Welcome Albert
Einstein!)
Then the system asks the teller to choose a transaction option:
1. List customers’ summary
Lists the summary of the customers’ information in a table on the screen. Customers number
Customers name
Customers balance
2. Add a new customer
Asks the teller to enter data for a new customer.
The customer number is chosen by the system randomly but it should not be already
assigned to another customer.
3. Show specific customer information
Ask the teller to enter either an account number or a name
If the account number exist the system shows the full information of the customer
If the name exist the system shows the list of all customers who their names
matched with the key then the teller chooses one of them then the system shows
the full information of the chosen customer
4. Delete specific customer
The system only accepts customer number
If it matches it asks for confirmation after the confirmation the system deletes all the
information of the customer from the database file.
5. Deposit money to the customer account
The system only accepts customer number
If it matches the system asks the teller that how much should be deposited, and after
the teller entered the value it updates the customer’s balance in the database file.
6. Withdraw money from the customer account
The system only accepts customer number
If it matches the system asks the teller that how much should be deposited, and after
the teller entered the value it updates the customer’s balance in the database file.
7. Log out
The system goodbyes the tellers and the program terminates.