boat

Pseudocode

IF...THEN...ELSE...ENDIF

A customer has a bank balance.

The customer can withdraw money as long as it does not exceed the balance.

If the customer tries to withdraw more money than the balance an error message appears.

Pseudocode

balance ← 1000

PRINT "How much money do you want to withdraw?"

withdraw ← USERINPUT

IF balance-withdraw < 0 THEN

PRINT "You do not have enough money!"

ELSE

PRINT "Please take your money."

balance ← balance - withdraw

PRINT "Your new balance is ", balance

ENDIF

Check out the pseudocode - yes, it is pretending to be code, but it's not really.

Notice anything wierd?

There is a ←

What does this represent in pseudocode?

Notice the structure of an if statement. It is quite different from Python or Java or Ruby:

IF condition THEN

...

ELSE

...

ENDIF

and look at how input is expressed in pseudocode:

withdraw ← USERINPUT