Question: Design the Java classes named Shape, Rectangle and Point by taking into account the following UML diagram: Write a Test class to verify your implementation.


Design the Java classes named Shape, Rectangle and Point by taking into account the following UML diagram: Write a Test class to verify your implementation. Shape -color: String -location : Point +Shape(String) +getX(): double +getY(): double +setLocation(double double): void +getColor(): String +setColor(String) : void +Print(): void Circle +radius: double +setCenter(double double): void +getCenter (): Point +setColor (String): void +getColor(): String +Print) : void +Circle(double) Point -x : double -y: double +getX(): double fsetX() : void +getY(): double +setY(): void +Print) : void Rectangle +width: double theight: double +getCornerLeftLow(): Point +getCornerLeftUpp0): Point +getCornerRightLow() : Point +getCornerRightUpp) : Point +setLocation(double double): void +setColor(String): void +getColor(): String +getArea(): double +Print(): void +Rectangle(double double) NOTES: (1) The location of a Rectangle object is defined as its lower left corner and the location of a circle is defined as its center. (2) The default color of each Rectangle and Circle object is White
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
