EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C/C++代写
您的位置: 主页 > 编程案例 > C/C++代写 >
代写C++/C:CS代写之C语言-程式設計二,HW11 - C++代写
发布时间:2021-07-25 22:26:31浏览次数:
程式碼中請勿有 system(“pause”);以免造成評分系統無法評分(理由已於上課中說明)各題輸出結果中,除有規定外,最後一列均不再換行 函數相關訊息則以每一橫列顯示,不同函數請換行顯示題目未以類別方式完成程式者均不計分第一題:定義一名為 GeometricObject 之類別,其中包含(a)一名為 color 之 privatestring 成員(b)ㄧ名為 filled之 privateboolean成員(c)一建構子,無接受參數,負責將 color 指定為 “white”,將 filled指定為 flase,並印出“Constructor1”後換行(d)一建構子,接受一個 stringcolor參照及 bool filled 參數,負責將傳遞進來的參數 color及 filled 分別指定給 color 及 filled 成員,並印出 “Constructor2”後換行(e)一傳回string 之public getColor 成員函數,無接受參數,傳回color 成員之值(f)一無回傳值之public setColor 成員函數,接受一個名為color的string參數,負責將傳遞進來的參數color 指定給color 成員(g)一傳回boolean之public isFilled 成員函數,無接受參數,傳回filled成員之值(h)一無回傳值之public setFilled 成員函數,接受一個名為filled的boolean參數,負責將傳遞進來的參數filled指定給filled成員(i)一傳回string 之public toString 成員函數,無接受參數,傳回如下格式之string Color: color成員值 Filled: filled成員值其中 color 成員值為 color 成員字串值(“white”, “red”, ….), filled 成員值為 filled 成員值(True or False)亦即印出之格式為 “Color:XXX□Filled:XXXXXXXX 為 white、red、…XXXXX 為 True 或 False以上所有成員函數均為 public另外包含一名為 Circle 且 public 繼承 GeometricObject 之類別,其中包含(a)一名為 radius 之 private double成員(b)一建構子,無接受參數,將 radius成員之值設定為 1,並印出“CConstructor1”後換行 (c)一建構子,接受接受一個名為 radius的 double參數,負責將傳遞進來的參數 radius 指定給 radius成員,並印出“CConstructor2”後換行,若傳遞進來之 radius值小於 0,則印出“Wrong”後換行,同時將 radius 成員設成 0。(d)一建構子,接受接受一個名為 radius的 double參數、一個名為 color的 string參照、一個名為 filled 的 bool參數,負責將傳遞進來的參數 radius指定給 radius 成員、將傳遞進來的參數 color及 filled分別指定給 color及filled成員,並印出“CConstructor3”後換行, 若傳遞進來之 radius 值小於 0,則印出“Wrong”後換行,同時將 radius 成員設成 0。(e)一傳回double之public getRadius 成員函數,無接受參數,傳回radius成員之值(f)一無回傳值之 publicsetRadius成員函數,接受參數一個名為 radius的 double參數, 負責將傳遞進來的參數 radius指定給 radius成員,若傳遞進來之 radius值小於 0,則印出“Wrong”後換行,同時將 radius成員設成 0。(g)一傳回double 之public getArea 成員函數,無接受參數,傳回圓面積(radius*radius*3.14159)(h)一傳回double 之public getDiameter 成員函數,無接受參數,傳回圓直徑(2*radius)(i)一傳回double 之public getPerimeter 成員函數,無接受參數,傳回圓周長(2*radius*3.14159)(j)一無回傳值之public toString 成員函數,無接受參數,傳回如下格式之string CColor: color成員值Radius:radius 成員值其中 color 成員值為 color 成員字串值(“white”, “red”,….), radius 成員值為radius 成員值亦即印出之格式為 “CColor:XXX□Radius:XXXXXXXX 為 white 、 red 、 … XXXXX為 radius成員值(小數點後印出六位)以上所有成員函數均為 public另外包含一名為 Rectangle 且 public 繼承 GeometricObject 之類別,其中包含(a)一名為 width之 privatedouble成員(b)一名為 height之 privatedouble成員(c)一建構子,無接受參數,將 width成員值設為 1、height成員值設為 1,並印出“RConstructor2”後換行,(d)一建構子,接受名為 width及 height的 double參數,負責將傳遞進來的參數 width指定給 width成員,及傳遞進來的參數 height指定給 height成員。並印出“RConstructor2”後換行,若傳遞進來之 width或 height之值小於 0,則印出“Wrong”後換行,並將傳遞進來之值為 0 者相對應之 width或 height 成員設成 0。(e)一建構子,接受接受名為 width 及 height的 double參數、一個名為 color的 string參照、一個名為 filled的 bool參數,負責將傳遞進來的參數 width指定給 width成員、傳遞進來的參數 height指定給 height成員、傳遞進來的參數 color 及 filled分別指定給 color 及filled 成員。並印出“RConstructor3”後換行,若傳遞進來之 width 或 height 之值小於 0, 則印出“Wrong”後換行,並將傳遞進來之值為 0 者相對應之 width 或 height 成員設成 0。(f)一傳回double 之public getWidth 成員函數,無接受參數,傳回width成員之值(g)一傳回double 之public getHeight 成員函數,無接受參數,傳回height成員之值(h)一無回傳值之public setWidth 成員函數,接受參數一個名為width的double參數, 負責將傳遞進來的參數width指定給width成員。若傳遞進來之width小於0,則印出“Wrong”後換行,並將 width 成員設成 0。(i)一無回傳值之 publicsetHeight成員函數,接受參數一個名為 height的 double參數, 負責將傳遞進來的參數 height指定給 height成員。若傳遞進來之 height值小於 0,則印出“Wrong”後換行,並將 height 成員設成 0。(j)一傳回double 之public getArea 成員函數,無接受參數,傳回矩形面積(width*height) (k)一傳回double 之public getPerimeter 成員函數,無接受參數,傳回矩形周長(2*(width+height))(l)一無回傳值之public toString 成員函數,無接受參數,傳回如下格式之string The Rheight: height成員值Rwidth: width成員值亦即印出之格式為 “Rheight:XXX□Rwidth:XXXXXXXX 為 heigth 成員之值,XXXXX 為 width 成員之值 (小數點後印出六位)以上所有成員函數均為 public前述定義中,均需檢查所使用的 width、height、radius 等是否合理(因代表長、寬、半徑等,故均需 =0)主程式 main 中則須依序包含下列功能程式碼作測試用。為表示空白,程式中□表示英文空白實際程式輸入時請把□換成英文空白intmain()GeometricObjectshape;shape.setColor( red shape.setFilled(true);cout shape.toString() endl color:□ shape.getColor() filled:□ (shape.isFilled()? true : false ) endl;Circlecircle(5);circle.setColor( black circle.setFilled(false);cout circle.toString() endl color:□ circle.getColor() filled:□ (circle.isFilled()? true : false ) radius:□ circle.getRadius() area:□ circle.getArea() perimeter:□ circle.getPerimeter() endl;Circlecircle1(-5);circle1.setColor( black circle1.setFilled(false);cout circle1.toString() endl color:□ circle1.getColor() filled:□ (circle1.isFilled()? true : false ) radius:□ circle1.getRadius() area:□ circle1.getArea() perimeter:□ circle1.getPerimeter() endl;stringstrc( red Circlecircle2(2.5,strc,false);circle2.setColor( black circle2.setFilled(false);cout circle2.toString() endl color:□ circle2.getColor() filled:□ (circle2.isFilled()? true : false ) radius:□ circle2.getRadius() area:□ circle2.getArea() perimeter:□ circle2.getPerimeter() endl;Rectanglerectangle(2,3);rectangle.setColor( orange rectangle.setFilled(true);cout rectangle.toString() endl color:□ rectangle.getColor() filled:□ (rectangle.isFilled()? true : false ) width:□ rectangle.getWidth() height:□ rectangle.getHeight() area:□ rectangle.getArea() perimeter:□ rectangle.getPerimeter() endl;Rectanglerectangle1(2,0);rectangle.setColor( orange rectangle.setFilled(true);cout rectangle1.toString() endl color:□ rectangle1.getColor() filled:□ (rectangle1.isFilled()? true : false ) width:□ rectangle1.getWidth() height:□ rectangle1.getHeight() area:□ rectangle1.getArea() perimeter:□ rectangle1.getPerimeter() endl;return0;}(100%) 未依規定要求項目完成者不計分代写CS Finance|建模|代码|系统|报告|考试编程类:C++,JAVA ,数据库,WEB,Linux,Nodejs,JSP,Html,Prolog,Python,Haskell,hadoop算法,系统 机器学习金融类:统计,计量,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导天才写手,代写C,代写R,代写JAVA,考试助攻E-mail:[email protected]微信:BadGeniuscs 工作时间:无休息工作日-早上8点到凌晨3点如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。