Guest User

Untitled

a guest
Nov 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. calculate (expression)
  2. (a b c)=split expression on " "
  3. if a is a number righthand=a else righthand=calculate(a)
  4. if c is a number lefthand=c else righthand=calculate(c)
  5. case b
  6. ='+' return a+c
  7. ='/' return a/c
  8. ='*' return a*c
  9. and so on
Add Comment
Please, Sign In to add comment