精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • 設(shè)計一個園類circle和一個桌子類table,circle類包括私有數(shù)據(jù)成員半徑radius和求圓面積得成員函數(shù)getarea():table類包含私有數(shù)據(jù)成員height(高度)和返回高度的成員函數(shù)getheight().另設(shè)計一個圓桌

    設(shè)計一個園類circle和一個桌子類table,circle類包括私有數(shù)據(jù)成員半徑radius和求圓面積得成員函數(shù)getarea():table類包含私有數(shù)據(jù)成員height(高度)和返回高度的成員函數(shù)getheight().另設(shè)計一個圓桌類roundtable,它是從前兩個類的派生,roundtable類繼承所有上述類得數(shù)據(jù)成員和成員函數(shù),添加了私有數(shù)據(jù)成員color和相應(yīng)的成員函數(shù).要求輸出一個圓桌得高度、面積和顏色等數(shù)據(jù).
    其他人氣:210 ℃時間:2019-12-13 17:39:02
    優(yōu)質(zhì)解答
    class circle
    {
    float radius;
    float area;
    public:
    circle(float r)
    {radius=r; }
    float getarea(void)
    {area=3.14*radius*radius; return area;}
    };
    class table
    {
    float height;
    public:
    table(float h)
    {height=h;}
    float getheight(void)
    {return height;}
    };
    class roundtable : public table, public circle
    {
    TColor color;
    public:
    roundtable(float h,float r,TColor c):circle(r), table(h)
    {color=c;}
    TColor getcolor(void)
    {return color;}
    };
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點,以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機版