How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLProg Your Own Question
ATLProg, Software Engineer
Category: Homework
Satisfied Customers: 9151
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
Type Your Homework Question Here...
ATLProg is online now
A new question is answered every 9 seconds

(Enable Rectangle comparable) Rewrite the Rectangle class to

This answer was rated:

(Enable Rectangle comparable) Rewrite the Rectangle class to extend GeometricObject and implement the comparable interface.Override the equals method in the object class. Two rectangle objects are equal if their areas are the same. Draw the UML diagram that involves Rectangle, GeometricObject and comparable.
Customer: replied 3 years ago.
Relist: I still need help.
Hello Welcome. Thank you for your question, I’m ATLProg and I’ll try to help you.

How soon do you need this answer ?
Customer: replied 3 years ago.

As soon as possible, with the price in mind.

ok, working on it. Price is reasonable on this one
Customer: replied 3 years ago.

Marvellous, thank you. Smile

Welcome, pls check back in a few hrs..thanks. Will leave you a message as soon as I am done
Customer: replied 3 years ago.

Will do.

Okay, thanks.


Customer: replied 3 years ago.

What information would you like?

Whatever info you have please pass it on
Customer: replied 3 years ago.

package chapter11;


public class RectangleFromSimpleGeometricObject

extends SimpleGeometricObject {
private double width;
private double height;

public RectangleFromSimpleGeometricObject() {

public RectangleFromSimpleGeometricObject(
double width, double height) {
this.width = width;
this.height = height;

public RectangleFromSimpleGeometricObject(
double width, double height, String color, boolean filled) {
this.width = width;
this.height = height;

/** Return width */
public double getWidth() {
return width;

/** Set a new width */
public void setWidth(double width) {
this.width = width;

/** Return height */
public double getHeight() {
return height;

/** Set a new height */
public void setHeight(double height) {
this.height = height;

/** Return area */
public double getArea() {
return width * height;

/** Return perimeter */
public double getPerimeter() {
return 2 * (width + height);

ok. thx
Customer: replied 3 years ago.

Youre welcome

Customer: replied 3 years ago.

Edited last post.


Help is still needed.

ok, I will keep working
Customer: replied 3 years ago.

will the question be answered today?

Customer: replied 3 years ago.


Still working on it
Can you give me code for SimpleGeometricObject as well please ?
Customer: replied 3 years ago.

Sure thing.


package chapter15;

public abstract class GeometricObject {
private String color = "white";
private boolean filled;
private java.util.Date dateCreated;

/** Construct a default geometric object */
protected GeometricObject() {
dateCreated = new java.util.Date();

/** Construct a geometric object with color and filled value */
protected GeometricObject(String color, boolean filled) {
dateCreated = new java.util.Date();
this.color = color;
this.filled = filled;

/** Return color */
public String getColor() {
return color;

/** Set a new color */
public void setColor(String color) {
this.color = color;

/** Return filled. Since filled is boolean,
* the get method is named isFilled */
public boolean isFilled() {
return filled;

/** Set a new filled */
public void setFilled(boolean filled) {
this.filled = filled;

/** Get dateCreated */
public java.util.Date getDateCreated() {
return dateCreated;

/** Return a string representation of this object */
public String toString() {
return "created on " + dateCreated + "\ncolor: " + color +
" and filled: " + filled;

/** Abstract method getArea */
public abstract double getArea();

/** Abstract method getPerimeter */
public abstract double getPerimeter();


You need to spend $3 to view this post. Add Funds to your account and buy credits.
ATLProg and other Homework Specialists are ready to help you
Any other questions I can help with ?
Please make sure to start your question text with "For ATLProg Only"

Related Homework Questions