php练习7——类的运用(四则运算or面积计算[javascript小技巧——根据需求显示不同界面])

  • 要求:请编写一个类,该类可以进行四则运算,也可以进行矩形面积计算

       1、程序

           viewCount.html

   

    Count.class.php

     

     printCount.php

   

       2、结果

       

        

  • 要求:将四则运算器和面积运算器合二为一,主菜单让用户选择做四则运算还是面积计算   

        1、程序

    viewCount1.html 用到一点javascript的知识

        

     

    Count.class.php 类文件不变

     

   printCount1.php

     

        2、结果

      

    

    

    

 

原文地址:https://www.cnblogs.com/seaBiscuit0922/p/5736451.html