Question: Write 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

Write 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 5 different customers. You can limit the maximum number of accounts in the bank by 40. Store all accounts in memory as an array, 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:

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 proceeds based on the users selection as follows:

user selects 0, the program terminates (for any other choices, the program does something and then returns to the menu).

user selects 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.

user selects 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.

user selects 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).

user selects 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.

user selects 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.

user selects 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!