Computer Question 1: Write Matlab code that performs the basic tasks of an ATM machine. The starting account balance is $500. Ask the user to enter a PIN, and accept any four digit integer. If they don’t enter a four digit integer as the PIN, your program should display “Incorrect PIN” and can stop right there. Now, display a menu asking the user whether he/she would like to deposit funds, withdraw funds, or display the account balance. Include a fourth menu item, “Return Card.” * If the user is depositing, ask how much to deposit and add it to the account balance. * If the user is withdrawing, allow withdrawing if there is enough money in the account and subtract it from the account balance. If there are insufficient funds, do not allow withdrawal and display an error message. Keep displaying the menu after each transaction (thus allowing additional transactions) until the user chooses “Return Card.” At that point, use fprintf to display the final account balance. Computer Question 2:
This is the end of the preview. Sign up
access the rest of the document.
This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.