Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*****PLEASE TEST AND MAKE SURE CODE WORKS***** Write a C program for managing bank accounts. All account information should be stored in a binary file

*****PLEASE TEST AND MAKE SURE CODE WORKS*****

Write a C program for managing bank accounts. All account information should be stored in a binary file info.dat. The file info.dat should contain at least 2 different customers. The max number of accounts in the bank is 10. Store all accounts in memory as an array but any change on any account should be reflected in the data file (info.dat) not only on exit.

For each customer the data file should store the following fields:

First name

Last name

Account number (any 5 digit number)

Account balance

The menu should have the following options:

1. Exit

2. Deposit

3. Withdrawal

4. Add account

5. Remove account

6. Balance inquiry

7. View accounts

The program continues based on the users selection as follows --

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

user input 2, 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 input 3, 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 input 4, 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 input 5, 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 input 6, 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 input 7, 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago