Cone of volume using the OOP of php

using accesser method,property,


  class Cone1{
  const PI = 3.14;
  private $radius;
  private $height;</p>

<p>public function setRadius($base){
    $this-&gt;radius = $base;
  public function setHeight($height){
    $this-&gt;height = $height;
  public function getRadius(){
    return $this-&gt;radius;
  public function getHeight(){
    return $this-&gt;height;
  public function getVolume(){
    $area = pow($this-&gt;radius,2) * self::PI;
    return $area * $this-&gt;height / 3;

&lt;!DOCTYPE html&gt;
    &lt;meta charset=&quot;utf-8&quot;&gt;
    &lt;title&gt;The volume of the cone&lt;/title&gt;
    &lt;h2&gt;use OOP of PrivateAccesser&lt;/h2&gt;
        require_once 'Cone1.php';
        $obj = new Cone1();
        print &quot;The bottom surface of the radius: {$obj-&gt;getRadius()}&quot; . '&lt;br&gt;';
        print &quot;The height of the cone: {$obj-&gt;getHeight()}&quot; . '&lt;br&gt;';</p>

<pre><code>    print &amp;quot;The volume of the cone: {$obj-&amp;gt;getVolume()}&amp;quot;;


(Visited 1 times, 1 visits today)