A- Computer QuestionsExam 2

A- Computer QuestionsExam 2 - Computer Question 1: Write...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
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:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online