Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Zadanie</title>
  4. </head>
  5. <body>
  6. <?php
  7. class prostopadloscian
  8. {
  9. public $pole;
  10. public $objetosc;
  11. public $a;
  12. public $b;
  13. public $h;
  14.  
  15. function pole(){
  16.  
  17. $pole = 2*$this->$a*2*$this->$b+2*$this->$b*2*$this->$h+2*$this->$a*2*$this->$h;
  18. return $this->pole;
  19. }
  20.  
  21.  
  22.  
  23. }
  24. $c=new prostopadloscian();
  25. $c->a="300";
  26. $c->b="200";
  27. $c->h="100";
  28. $c->pole;
  29. print("Długość:".$c->a."<br>");
  30. print("Szerokość:".$c->b."<br>");
  31. print("Wysokość:".$c->h);
  32. ?>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement