SHARE
TWEET

11

a guest Dec 10th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <meta charset=""UTF-8"/>
  3. </head>
  4. <body>
  5. <?php
  6. class Kwadrat{
  7. public $a;
  8. private $pole;
  9. public function policzPole(){
  10.     $this->pole = $this->a*$this->a;
  11. }
  12.     public function pokazPole(){
  13.     echo " Pole kwadratu o długości boku $this->a wynosi $this->pole</br>";
  14.     return $this->pole;
  15.     }
  16. }
  17. $kwadrat1 = New Kwadrat();
  18. $kwadrat1->a=5;
  19. $kwadrat1->policzPole();
  20. $pole=$kwadrat1->pokazPole();
  21. echo "Wartosc pola z obiektu kwadrat1 zwrócona do zmiennej \$pole=$pole";
  22. ?>
  23. </body>
  24. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top