Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

\f\f

Answered: 1 week ago