Course Solutions Uncategorized (Solved) : Java Project 10 Design Class Named Triangle Extends Abstract Class Geometricobject Import Q28247553 . . . .

(Solved) : Java Project 10 Design Class Named Triangle Extends Abstract Class Geometricobject Import Q28247553 . . . .

 

Java Project 10  

Design aclass  namedTriangle that extends the abstractclass  GeometricObject:

importjava.util.Scanner;

abstractclass  GeometricObject{
private  Stringcolor = “white”;
private  booleanfilled;
private  java.util.DatedateCreated;

/** Construct adefault geometricobject */
protected
GeometricObject(){
}

/** Construct ageometric object with color andfilled value */
protected
GeometricObject(Stringcolor, boolean filled) {
dateCreated = newjava.util.Date();
this.color = color;
this.filled = filled;
}

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

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

/** Return filled. Since filled is boolean ,
* the get
method isnamed  isFilled*/
publicboolean  
isFilled(){
return filled;
}

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

/** Get dateCreated */
public
java.util.DategetDateCreated() {
return
dateCreated;
}

@Override
public
String toString() {
return “created on ” +
dateCreated+ “ncolor: ” + color+
” and filled: ” + filled;
}

/** Abstractmethod  getArea*/
public abstract
double  getArea();

/** Abstractmethod  getPerimeter*/
public abstract
double  getPerimeter();
}

The Triangle classcontains:

Three double datafields named side1, side2,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : 11. Creativity, Multi-Topic To what extent do you think creativity is the result of individual factors such as personality versu(Answered) : 11. Creativity, Multi-Topic To what extent do you think creativity is the result of individual factors such as personality versu

11. Creativity, Multi-Topic To what extent do you think creativity is the result of individual factors such as personality versus organizational factors such as incentive structures or the diversity of