Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*****PLEASE TEST AND MAKE SURE CODE WORKS!!!!!!!!!!!!! I WILL UPVOTE FOR ANSWER IF CODE WORKS***** ****SEE ATTACHED IMAGE FOR OUTPUT**** Write a C program to

*****PLEASE TEST AND MAKE SURE CODE WORKS!!!!!!!!!!!!! I WILL UPVOTE FOR ANSWER IF CODE WORKS*****

****SEE ATTACHED IMAGE FOR OUTPUT****

Write a C program to manage bank accounts. All account information should be stored in a binary file account.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 (account.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.

image text in transcribed

0. Exit 1. Deposit 2. Withdrawal 3. Add account 4. Remove account S. Balance inquiry 6. View accounts Enter 0, 1, 2, 3, 4, 5, or 6 VIEW ACCOUNTS Account No.: 123456 Nane: Balance John W Doe $600.00 Account No.: 234567 Nane: Balance: Jane K Jones $908.08 0. Exit 1. Deposit 2. Withdrawal 3. Add account 4. Remove account 5. Balance inquiry 6. View accounts Enter 0, 1, 2, 3, 4, 5, or 6 >DEPOSIT Account Nunber0 ERROR: The account nunber nust contain 6 digits! 0. Exit 1. Deposit 2. Withdrawal 3. Add account 4. Remove account 5. Balance inquiry 6. View accounts Enter 0, 1. 2, 3, 4. 5, or 6 0. Exit 1. Deposit 2. Withdrawal 3. Add account 4. Remove account S. Balance inquiry 6. View accounts Enter 0, 1, 2, 3, 4, 5, or 6 VIEW ACCOUNTS Account No.: 123456 Nane: Balance John W Doe $600.00 Account No.: 234567 Nane: Balance: Jane K Jones $908.08 0. Exit 1. Deposit 2. Withdrawal 3. Add account 4. Remove account 5. Balance inquiry 6. View accounts Enter 0, 1, 2, 3, 4, 5, or 6 >DEPOSIT Account Nunber0 ERROR: The account nunber nust contain 6 digits! 0. Exit 1. Deposit 2. Withdrawal 3. Add account 4. Remove account 5. Balance inquiry 6. View accounts Enter 0, 1. 2, 3, 4. 5, or 6

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

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

Describe the nature of negative messages.

Answered: 1 week ago