Question: Write an algorithm for an ATM program. Think about where there would be selection statements, menus, loops (counted vs. conditional), etc. but dont write MATLAB
Write an algorithm for an ATM program. Think about where there would be selection statements, menus, loops (counted vs. conditional), etc. but dont write MATLAB code, just an algorithm (pseudo-code).
I know the MatLab code would be:
balance = 500; pin = input('Enter PIN'); c = menu('Choose:','deposit','withdraw','display','return card'); while(c<4) switch c case 1 x = input('Add how much?'); if(x>0) balance = balance+x; end case 2 x = input('Withdraw how much?'); balance = balance-x; else error('Insufficient Funds'); end case 3 fprintf('Your money is at %.2f ', balance); case 4 fprintf('Your money is at %.2f ', balance); break; end c = menu('Choose:','deposit','withdraw','display','return card'); end else disp('Incorrect PIN.'); end
**But I need to make this just an algorithm (pseudo-code)!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
