Implement the following class diagram. Shape #color:String +Shape(color:String ) +getColor ():String +setColor (color :String): void +getArea():double Circle Rectangle #radius:double #width:double #length:double +Circle(radius: double, color:String ) +getRadius(): double +setRadius (radius:double):void +getArea(): double +Rectangle(width:double, length:double, color:String ) +getwidth (): double +setwidth (width:double):void +getlength(): double +setlength(legnth:double):void +getArea(): double 全 Square +Square(side:double,color:String) +getSide(): double +setSide(side:double):void +setwidth (side: double): void +setlength(side:double):void

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

inheritance in c++

Implement the following class diagram.
Shape
#color:String
+Shape(color:String )
+getColor ():String
+setColor (color :String): void
+getArea():double
Circle
Rectangle
#radius:double
#width:double
#length:double
+Circle(radius: double,
color:String )
+getRadius(): double
+setRadius (radius:double):void
+getArea(): double
+Rectangle(width:double, length:double,
color:String )
+getwidth (): double
+setwidth (width:double):void
+getlength(): double
+setlength(legnth:double):void
+getArea(): double
全
Square
+Square(side:double,color:String)
+getSide(): double
+setSide(side:double):void
+setwidth (side: double): void
+setlength(side:double):void
Transcribed Image Text:Implement the following class diagram. Shape #color:String +Shape(color:String ) +getColor ():String +setColor (color :String): void +getArea():double Circle Rectangle #radius:double #width:double #length:double +Circle(radius: double, color:String ) +getRadius(): double +setRadius (radius:double):void +getArea(): double +Rectangle(width:double, length:double, color:String ) +getwidth (): double +setwidth (width:double):void +getlength(): double +setlength(legnth:double):void +getArea(): double 全 Square +Square(side:double,color:String) +getSide(): double +setSide(side:double):void +setwidth (side: double): void +setlength(side:double):void
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Transitive relations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT