From b965eb03d23c222d232c05fcce8008525ff335e4 Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 09:15:11 +0500 Subject: [PATCH 1/8] Add files via upload --- homework2 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 homework2 diff --git a/homework2 b/homework2 new file mode 100644 index 0000000..c854b86 --- /dev/null +++ b/homework2 @@ -0,0 +1,74 @@ +width = $width; + $this->height = $height; + } + + public function getArea(){ + return $this->width * $this->height; + } + + public function getPerimeter(){ + return $this->width * 2 + $this->height * 2; + } +} + +class Square extends Figure{ + private $side; + public function __construct($side) { + $this->side = $side; + } + + public function getArea(){ + return $this->side ** 2; + } + + public function getPerimeter(){ + return $this->side * 4; + } + +} + +class Circle extends Figure{ + private $radius; + public function __construct($radius) { + $this->radius = $radius; + } + + public function getArea(){ + return round(pi() * ($this->radius ** 2),2); + } + + public function getPerimeter(){ + return round(2 * pi() * $this->radius,2); + } +} +class Triangle extends Figure{ + private $base; + private $side1; + private $side2; + private $height; + + public function __construct($base,$side1,$side2,$height) { + $this->base = $base; + $this->side1 = $side1; + $this->side2 = $side2; + $this->height = $height; + } + + public function getArea(){ + return ($this->base * $this->height) / 2; + } + + public function getPerimeter(){ + return $this->side1 + $this->side2 + $this->base; + } +} \ No newline at end of file From 93ce045b366aa953928b12744db54150c43fd530 Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 09:16:01 +0500 Subject: [PATCH 2/8] Delete homework2 --- homework2 | 74 ------------------------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 homework2 diff --git a/homework2 b/homework2 deleted file mode 100644 index c854b86..0000000 --- a/homework2 +++ /dev/null @@ -1,74 +0,0 @@ -width = $width; - $this->height = $height; - } - - public function getArea(){ - return $this->width * $this->height; - } - - public function getPerimeter(){ - return $this->width * 2 + $this->height * 2; - } -} - -class Square extends Figure{ - private $side; - public function __construct($side) { - $this->side = $side; - } - - public function getArea(){ - return $this->side ** 2; - } - - public function getPerimeter(){ - return $this->side * 4; - } - -} - -class Circle extends Figure{ - private $radius; - public function __construct($radius) { - $this->radius = $radius; - } - - public function getArea(){ - return round(pi() * ($this->radius ** 2),2); - } - - public function getPerimeter(){ - return round(2 * pi() * $this->radius,2); - } -} -class Triangle extends Figure{ - private $base; - private $side1; - private $side2; - private $height; - - public function __construct($base,$side1,$side2,$height) { - $this->base = $base; - $this->side1 = $side1; - $this->side2 = $side2; - $this->height = $height; - } - - public function getArea(){ - return ($this->base * $this->height) / 2; - } - - public function getPerimeter(){ - return $this->side1 + $this->side2 + $this->base; - } -} \ No newline at end of file From 2aba8f2c50e8f5fd6f8b2a6c63bbbc8af0f3663e Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 09:17:22 +0500 Subject: [PATCH 3/8] Add files via upload --- homework2.php | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 homework2.php diff --git a/homework2.php b/homework2.php new file mode 100644 index 0000000..c854b86 --- /dev/null +++ b/homework2.php @@ -0,0 +1,74 @@ +width = $width; + $this->height = $height; + } + + public function getArea(){ + return $this->width * $this->height; + } + + public function getPerimeter(){ + return $this->width * 2 + $this->height * 2; + } +} + +class Square extends Figure{ + private $side; + public function __construct($side) { + $this->side = $side; + } + + public function getArea(){ + return $this->side ** 2; + } + + public function getPerimeter(){ + return $this->side * 4; + } + +} + +class Circle extends Figure{ + private $radius; + public function __construct($radius) { + $this->radius = $radius; + } + + public function getArea(){ + return round(pi() * ($this->radius ** 2),2); + } + + public function getPerimeter(){ + return round(2 * pi() * $this->radius,2); + } +} +class Triangle extends Figure{ + private $base; + private $side1; + private $side2; + private $height; + + public function __construct($base,$side1,$side2,$height) { + $this->base = $base; + $this->side1 = $side1; + $this->side2 = $side2; + $this->height = $height; + } + + public function getArea(){ + return ($this->base * $this->height) / 2; + } + + public function getPerimeter(){ + return $this->side1 + $this->side2 + $this->base; + } +} \ No newline at end of file From aaa6532a37ab5e56d90d494e169f1913ae2fb66b Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 10:44:19 +0500 Subject: [PATCH 4/8] Update homework2.php --- homework2.php | 55 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/homework2.php b/homework2.php index c854b86..ca228f0 100644 --- a/homework2.php +++ b/homework2.php @@ -1,74 +1,95 @@ width = $width; $this->height = $height; } - public function getArea(){ + public function getArea() + { return $this->width * $this->height; } - public function getPerimeter(){ + public function getPerimeter() + { return $this->width * 2 + $this->height * 2; } } -class Square extends Figure{ + +class Square extends Figure +{ private $side; - public function __construct($side) { + public function __construct($side) + { $this->side = $side; } - public function getArea(){ + public function getArea() + { return $this->side ** 2; } - public function getPerimeter(){ + public function getPerimeter() + { return $this->side * 4; } } + class Circle extends Figure{ private $radius; - public function __construct($radius) { + public function __construct($radius) + { $this->radius = $radius; } - public function getArea(){ + public function getArea() + { return round(pi() * ($this->radius ** 2),2); } - public function getPerimeter(){ + public function getPerimeter() + { return round(2 * pi() * $this->radius,2); } } -class Triangle extends Figure{ + + +class Triangle extends Figure +{ private $base; private $side1; private $side2; private $height; - public function __construct($base,$side1,$side2,$height) { + public function __construct($base,$side1,$side2,$height) + { $this->base = $base; $this->side1 = $side1; $this->side2 = $side2; $this->height = $height; } - public function getArea(){ + public function getArea() + { return ($this->base * $this->height) / 2; } - public function getPerimeter(){ + public function getPerimeter() + { return $this->side1 + $this->side2 + $this->base; } -} \ No newline at end of file +} From e53c6e8ebf3472fd0194403da2696fe853e827c2 Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 10:51:33 +0500 Subject: [PATCH 5/8] Update homework2.php --- homework2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homework2.php b/homework2.php index ca228f0..f119f55 100644 --- a/homework2.php +++ b/homework2.php @@ -49,7 +49,8 @@ public function getPerimeter() } -class Circle extends Figure{ +class Circle extends Figure +{ private $radius; public function __construct($radius) { From 846d8ad32367fe0af59b06c957c439acb546aeb0 Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 11:21:24 +0500 Subject: [PATCH 6/8] Update homework2.php --- homework2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homework2.php b/homework2.php index f119f55..20647e9 100644 --- a/homework2.php +++ b/homework2.php @@ -10,7 +10,7 @@ class Rectangle extends Figure { private $width; private $height; - public function __construct($width,$height) + public function __construct($width, $height) { $this->width = $width; $this->height = $height; @@ -76,7 +76,7 @@ class Triangle extends Figure private $side2; private $height; - public function __construct($base,$side1,$side2,$height) + public function __construct($base, $side1, $side2, $height) { $this->base = $base; $this->side1 = $side1; From f3454198e265f5277299713f9fbf3398aff07851 Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 11:22:26 +0500 Subject: [PATCH 7/8] Update homework2.php --- homework2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homework2.php b/homework2.php index 20647e9..81f68d0 100644 --- a/homework2.php +++ b/homework2.php @@ -59,12 +59,12 @@ public function __construct($radius) public function getArea() { - return round(pi() * ($this->radius ** 2),2); + return round(pi() * ($this->radius ** 2), 2); } public function getPerimeter() { - return round(2 * pi() * $this->radius,2); + return round(2 * pi() * $this->radius, 2); } } From 5f557f8f87b5d1fddd7dc9c409b060e70aeaade7 Mon Sep 17 00:00:00 2001 From: Sasha <106412494+AalexSanders@users.noreply.github.com> Date: Sat, 24 Dec 2022 11:22:47 +0500 Subject: [PATCH 8/8] Update homework2.php --- homework2.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homework2.php b/homework2.php index 81f68d0..ea1cc92 100644 --- a/homework2.php +++ b/homework2.php @@ -94,3 +94,5 @@ public function getPerimeter() return $this->side1 + $this->side2 + $this->base; } } + +?>