Exercise 3: Write a program to implement polymorphism with following class diagram » Shape#color:String#filled:boolean+Shape ()+Shape (color:String,filled:boolean)+getColor ():String+setColor...


Exercise    3:     Write    a    program    to    implement    polymorphism    with    following    class    diagram


<<abstract>» Shape<br>#color:String<br>#filled:boolean<br>+Shape ()<br>+Shape (color:String,filled:boolean)<br>+getColor ():String<br>+setColor (color:String):void<br>+isFilled ():boolean<br>+setFilled(filled:boolean):void<br>+getArea():double<br>+getPerimeter:double<br>+tostring ():String<br>Circle<br>Rectangle<br>#width:double<br>#length:double<br>#radius:double<br>+Circle()<br>+Circle(radius:double)<br>+Circle(radius:double,<br>color:String, filled:boolean)<br>+getRadius():double<br>+setRadius(radius:double):void<br>+getArea():double<br>+getPerimeter():double<br>+toString ():String<br>+Rectangle()<br>+Rectangle(width:double,length:double)<br>+Rectangle(width:double,length:double,<br>color:String, filled:boolean)<br>+getwidth ():double<br>+setwidth (width:double):void<br>+getLength():double<br>+setlength(legnth:double):void<br>+getArea():double<br>+getPerimeter():double<br>+tostring ():String<br>Square<br>+Square()<br>+Square(side:double)<br>+Square(side:double,color:String,<br>filled:boolean)<br>+getSide():double<br>+setSide(side:double):void<br>+setwidth (side: double):void<br>+setlength(side:double):void<br>+tostring ():String<br>

Extracted text: » Shape #color:String #filled:boolean +Shape () +Shape (color:String,filled:boolean) +getColor ():String +setColor (color:String):void +isFilled ():boolean +setFilled(filled:boolean):void +getArea():double +getPerimeter:double +tostring ():String Circle Rectangle #width:double #length:double #radius:double +Circle() +Circle(radius:double) +Circle(radius:double, color:String, filled:boolean) +getRadius():double +setRadius(radius:double):void +getArea():double +getPerimeter():double +toString ():String +Rectangle() +Rectangle(width:double,length:double) +Rectangle(width:double,length:double, color:String, filled:boolean) +getwidth ():double +setwidth (width:double):void +getLength():double +setlength(legnth:double):void +getArea():double +getPerimeter():double +tostring ():String Square +Square() +Square(side:double) +Square(side:double,color:String, filled:boolean) +getSide():double +setSide(side:double):void +setwidth (side: double):void +setlength(side:double):void +tostring ():String
Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here