aakash2310

Untitled

Nov 28th, 2022
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2. class Rectangle
  3. {
  4. public $length;
  5. public $width;
  6. public function __construct($x,$y)
  7. {
  8. $this -> length = $x;
  9. $this -> width = $y;
  10. }
  11. public function getPerimeter()
  12. {
  13. return (2 * ($this->length + $this->width));
  14. }
  15. public function getArea()
  16. {
  17. return ($this->length * $this->width);
  18. }
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment