Guest User

Untitled

a guest
Dec 14th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #!/bin/bash
  2. # enter your function code here
  3. function ENGLISH_CALC {
  4. case $2 in
  5. "plus") echo "$1 + $3 = $(($1 + $3))";;
  6. "minus") echo "$1 - $3 = $(($1 - $3))";;
  7. "times") echo "$1 * $3 = $(($1 * $3))";;
  8. esac
  9. }
  10.  
  11. # testing code
  12. ENGLISH_CALC 3 plus 5
  13. ENGLISH_CALC 5 minus 1
  14. ENGLISH_CALC 4 times 6
Add Comment
Please, Sign In to add comment