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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started