Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. namespace KodingKalaWeekend\Calculator;
  4.  
  5. class Calculator
  6. {
  7. public function add($a, $b)
  8. {
  9. $result = $a + $b;
  10. echo "Sum of {$a} and {$b} is {$result}\n";
  11. }
  12.  
  13. public function substract($a, $b)
  14. {
  15. $result = $a - $b;
  16. echo "Substract of {$a} and {$b} is {$result}\n";
  17. }
  18.  
  19. public function multiply($a, $b)
  20. {
  21. $result = $a * $b;
  22. echo "Multiply of {$a} and {$b} is {$result}\n";
  23. }
  24.  
  25. public function divide($a, $b)
  26. {
  27. $result = $a / $b;
  28. echo "Divide of {$a} and {$b} is {$result}\n";
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement