Question: Write a program in c , a menu-driven, interactive program for managing bank accounts. All account information should be stored in a binary file accounts.dat.
Write a program in c, a menu-driven, interactive program for managing bank accounts. All account information should be stored in a binary file accounts.dat. Your data file accounts.dat should contain at least 7 different customers when you submit this assignment. You can limit the maximum number of accounts in the bank by 50. You may store all accounts in memory (as an array), which should simplify most operations, but any change on any account should be immediately reflected in the data file (accounts.dat) not only on exit.
For each customer, the data file should store the following fields (you decide on reasonable data types):
First name
Middle initial
Last name
Account number (any 6-digit number)
Account balance
The menu should provide you with the following options:
0. Exit
1. Deposit
2. Withdrawal
3. Add account
4. Remove account
5. Balance inquiry
6. View accounts
The program then proceeds based on the users selection as follows:
If the user picks 0, the program terminates (for any other choices, the program does something and then returns to the menu).
If the user picks 1, the program asks about the account number and the amount to deposit, and performs the requested update in the data file. After performing the file update, the program should report the new balance on the affected account. If a wrong account number is provided, the program reports this and doesnt make any changes.
If the user picks 2, the program first asks for the account number and the amount to withdraw. If the current balance is insufficient to cover the withdrawal, the program reports this information and doesnt make any changes in the account. Otherwise, the program updates the file accordingly and prints out the new balance on the affected account. If a wrong account number is provided, the program reports this and doesnt make any changes.
If the user picks 3, the program asks for information about a new customer, and then creates an account for this customer. The (new) account number should also be provided on input. If the user provides an account number already used, then the program complains and doesnt perform the requested update (nothing is changed).
If the user picks 4, the program asks for an account number and it then removes the requested account from the data file. If a wrong account number is provided, the program reports this and doesnt make any changes.
If the user picks 5, the program asks for an account number and it then prints out all information about that account stored in the data file. If a wrong account number is provided, the program reports this and doesnt make any changes.
If the user picks 6, the program prints out all information about all accounts in the system (one by one).
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
