Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Zadanie</title>
- </head>
- <body>
- <?php
- class prostopadloscian
- {
- public $pole;
- public $objetosc;
- public $a;
- public $b;
- public $h;
- function pole(){
- echo("Pole: ");
- $pole = 2*$this->a*2*$this->b+2*$this->b*2*$this->h+2*$this->a*2*$this->h."<br>";
- return $pole;
- }
- function objetosc(){
- echo("Objętość: ");
- $objetosc = $this->a*$this->b*$this->h."<br><br>";
- return $objetosc;
- }
- }
- $c=new prostopadloscian();
- $c->a=500;
- $c->b=200;
- $c->h=100;
- print ($c->pole());
- print ($c->objetosc());
- print("Długość:".$c->a."<br>");
- print("Szerokość:".$c->b."<br>");
- print("Wysokość:".$c->h."<br><br>");
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement