Blogger Information
Blog 8
fans 0
comment 0
visits 5805
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
计算图形的面积与周长-5
柯二南的博客
Original
632 people have browsed it
<?php


class Rect extends Shape {

    private $width = 0;
    private $height = 0;

    function __construct() {
        $this->shapeName = '矩形';

        if ($this->validate($_POST["width"], "宽度") & $this->validate($_POST["height"], "高度")) {


            $this->width = $_POST["width"];
            $this->height = $_POST["height"];
        }
    }

    function area() {
        return $this->width * $this->height;
    }

    function perimoter() {
        return 2 * ($this->width + $this->height);
    }

}


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