Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

1. In what ways has flexible working revolutionised employment?

Answered: 1 week ago