Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a menu-driven, C interactive program for managing bank accounts. All account information shouldbe stored in a binary file accounts.dat. Your data file accounts.datshould contain

Write a menu-driven, C interactive program for managing bank accounts. All account information shouldbe stored in a binary file accounts.dat. Your data file accounts.datshould contain at least 7different customers when you submit this assignment. You can limit the maximum number of accounts in thebank 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 datatypes):

First name

Middle initia

lLast 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 accoun

t4. 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, andperforms the requested update in the data file. After performing the file update, the programshould 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. Ifthe current balance is insufficient to cover the withdrawal, the program reports this informationand doesnt make any changes in the account. Otherwise, the program updates the file accordinglyand 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 anaccount for this customer. The (new) account number should also be provided on input. If theuser provides an account number already used, then the program complains and doesnt performthe requested update (nothing is changed).

If the user picks 4, the program asks for an account number and it then removes the requestedaccount from the data file. If a wrong account number is provided, the program reports this anddoesnt make any changes.

If the user picks 5, the program asks for an account number and it then prints out all informationabout that account stored in the data file. If a wrong account number is provided, the programreports 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). UseMakefileto create bank as executable for problem respectively.

You must use 'git' while making yoursource files.should have at least 5 commit for any source files.

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions