Write a PHP calculator class which will accept two values as arguments, then add them, subtract them, multiply them together, or divide them on request
Write a PHP calculator class which will accept two values as arguments, then add them, subtract them, multiply them together, or divide them on request.
For example : $mycalc = new MyCalculator( 12, 6); echo $mycalc- > add(); // Displays 18 echo $mycalc- > multiply(); // Displays 72
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer