Blogger Information
Blog 8
fans 0
comment 0
visits 5816
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
计算图形的面积与周长-7
柯二南的博客
Original
568 people have browsed it
<?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!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post