<?php
class Circle extends Shape {
private $radius=0;
function __construct() {
$this->shapeName = '圆形';
if ($this->validate($_POST['radius'], '半径')) {
$this->radius = $_POST['radius'];
}
}
function area() {
return pi() * $this->radius * $this->radius;
}
function perimoter() {
return 2 * pi() * $this->radius;
}
}
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!