EashwarSS / drupal_8

0 stars 0 forks source link

No Core php use oops #2

Open shamsher198930 opened 4 years ago

shamsher198930 commented 4 years ago

https://github.com/EashwarSSK/drupal_8/blob/07153187e19534737747cd239fb4d534287df390/JUNE%205/CALCULATOR/calc.php#L16

EashwarSS commented 4 years ago

https://github.com/EashwarSSK/drupal_8/blob/07153187e19534737747cd239fb4d534287df390/JUNE%205/CALCULATOR/calc.php#L16

Basic Calculator

<?php

interface CreateCalculator { public function addition($x,$y); public function subtraction($m,$n); public function multiplication($e,$f); public function divide($a,$b); }

class Calculator implements CreateCalculator{

public function addition($x,$y){ 
    $z=$x+$y;
    echo "This is calculator using interface: <br> <br>";
    echo "addition of  $x , $y is " .$z. "<br>"; 
}

public function subtraction($m,$n){ 
    $l=$m-$n;
    echo "subtraction  of  $m  - $n is " .$l. "<br>"; 
} 
public function multiplication($e,$f){ 
    $g=$e*$f;
    echo "multiplication  of  $e * $f is " .$g. "<br>"; 
} 

public function divide($a,$b){ 
    $c=$a/$b;
    echo "division  of  $a / $b is " .$c. "<br>"; 
} 

}

$obj = new Calculator; $obj->addition(6,3); $obj->subtraction(15,6); $obj->multiplication(3,3); $obj->divide(18,2);

2020-06-26 (2)

EashwarSS commented 4 years ago

Hi sir,

i understood what the wrong i did.i updated code in github please check it once.

Thanks & Regards, Kadavala Eashwar

On Fri, Jun 26, 2020 at 1:56 PM shamsher198930 notifications@github.com wrote:

https://github.com/EashwarSSK/drupal_8/blob/07153187e19534737747cd239fb4d534287df390/JUNE%205/CALCULATOR/calc.php#L16

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EashwarSSK/drupal_8/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3EJHMQ4M2JEO2ZKCB3GKLRYRLTVANCNFSM4OJDQHJQ .