Question: Design a program to simulate a bank. Your program should read account numbers, PINs, and beginning balances from a text file. Each line of text

Design a program to simulate a bank. Your program should read account numbers, PINs, and beginning balances from a text file. Each line of text in the input file will have all the information about a single bank account - account number, PIN and beginning balance. All information fields are separated by semi-colons. Name of input file will be accounts.txt. Here is some sample input data:

102049516;5555;20000.00 402949148;2222;10000.00 696050179;9898;4500.00 

After reading the input, your program should keep prompting the user to either Withdraw or Deposit money or Quit the program. If the user chooses to Withdraw or Deposit money, then prompt the user for the account number and PIN. If the PIN does not match then let the user know about it and return the user back to the initial prompt (Withdraw or Deposit or Quit). If the PIN matches, then prompt the user for the amount of the transaction and update the balance accordingly. If the user tries to withdraw an amount that is more than the current balance, then do not allow the user to withdraw, let the user know about it and return the user back to the initial prompt (Withdraw or Deposit or Quit).

Upon quitting, print all account numbers and corresponding balances.

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 Programming Questions!