Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CPSC 1110- Data Structures and Program Design Homework3 (Chapter 9) Create a java program that includes the following classes in the following UML diagram.

image text in transcribed

CPSC 1110- Data Structures and Program Design Homework3 (Chapter 9) Create a java program that includes the following classes in the following UML diagram. Note the relationships between the classes GeometricObject -color: String -filled: boolean -dateCreated java util.Date +GeometricObject() +GeometricObject(color: String filled: boolean) +getColor(): String +setColor(color: String): void +isFilled: boolean +setFilled(filled boolean): void +getDate Created(): java.util.Date +toString(): String The color of the object (default: white). Indicates whether the object is filled with a color (default: false). The date when the object was created Creates a GeometricObject. Creates a GeometricObject with the specified color and filled values. Returns the color. Sets a new color. Returns the filled property. Sets a new filled property. Returns the dateCreated. Returns a string representation of this object. -radius: double +Circle() Circle +Circle(radius: double) +Circle(radius: double, color: String filled: boolean) +getRadius(): double +setRadius(radius: double): void +getArea(): double +getPerimeter): double +getDiameter): double +toString(): String -width: double -height: double +Rectangle( Rectangle +Rectangle(width: double, height: double) +Rectangle(width: double, height: double color: String, filled: boolean) +getWidth(): double +setWidth(width: double): void +getHeight): double +getArea(): double +setHeight(height double): void +getPerimeter): double The program should include four separate java files (including the ObjectTester class) In the ObjectTester (inside the main method) do the following: Create a GeometricObject object and call the toString method. Create a Rectangle using the two parameters constructor object and call the toString method Create a Rectangle using the four parameters constructor object and call the toString method Create a Circle using the one parameters constructor object and call the toString method Create a Circle using the three parameters constructor object and call the toString method Override the equals method in the Circle class so as to return true if colors, isFilled, and the radius are equal Compare two circle object created using the three parameters constructor by calling the equals method Compare the circle and the rectangle objects by calling equals method. What happened and how to solve this problem?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Programming questions

Question

4. Think of analogies that will make ideas easier to understand.

Answered: 1 week ago