Hello this is study question form my study guide for my Programing Midterm. We h
ID: 3724441 • Letter: H
Question
Hello this is study question form my study guide for my Programing Midterm.
We have been using Eclipse this whole semester and I would need to fill in the red parts of the missing code.
Could someone help me with this so I could use this to study? Thank you so very much !!!
Design and implement a class called CircleTromSimpleGeometricObject that is derived from the SimpleGeometricObject given below. Store values in the CircleFromSimpleGeometricObject that represents the datafield and add a method that compute perimeter. Please complete the “//ToDO" sections 1 public class SimpleGoometricobject1 public class 2 private St.rng colr"white"; 3 private boolean filled; 4 private java.util.Dato datoCreated 3 private double radiusi CircleFromSimpleGeometricObject //TODo1 **Construct a default Circlet roms irnpleGeornetric0bjecL */ 6 Construct a default geometric object */ 7 public SimpleGcometricobject 8 dateCreated-new java.util.Date 5 //TODO 2 11 /** Construct a geometric object with tho spocitiod color 12 and fil1ed value * / 13 public SimpleGeometricobject (String public color, boolean tillod) 1 14 dateCreatednew java.ut.i1.Dat.e radis) 15 this.colorcolor; **Construct a CircloFromSimploGoometricobjoct with a given radius */ CircloFroSimploGoomotricobjoct (double 9????????????????????????? //TODO 3 **Construct a 19 /** Return color */ 20 public String getColo 21 return color; qiven radius, color and filled / 12 public CircleFromSimpleGeometricobiect (double radius, 24 Set a new color 25 public void :;-LColor (String color) | 13 String color, boolean [illed ) [ 26 this.colocolor; //TODO 4 //TODO 5 //TODO 6 14 ?????????????? 16 ???? ?2 2?????? 29 /** Return filled. Since filled is17 boolean 30 its got tor mothoa is namod 3Fi11oa | 19 /** Roturn radius */ 20 public double get Radius //TODO 7 31 public boolean isFilled) f 32 return fillod: 24 Set a new radius */ 36 public void setFi1led (boolean tilled) 37 thí s . rilled - r111-d ; 38 39 10 ** Get. dat.eCreated 41 public java.util.Date getDateCreated) I 12 return da teCreated; 25 public void setRadius (double radius) //TODO 8 29 * Roturn arca 30 public double getArea f 31 ??????????????????????//TODO9 34 /** Return diameter 35 public double qetDiametor ) 45 /** Retur a string representation ot this objoct / 6 public St.ring tostring 7 return "created on "+ dateCreated 39 /Return perimeter */ " color:"color 48 and filled filled; 49) //TODO 10 40 public double gotPerimotor) l 41 ??????????????????//TODO 11 4 3 44 /** Print th circle info */ 45 public void printCircle ) 46 Systom.out.println ("The circle is created "qetDateCreated)+ 47 " and the radius is"+ radius);Explanation / Answer
ToDo 1
{ //forgot the curly braces
private String color="White";
private boolean filled;
ToDo2
public CircleFromSimpleGeometricObject(){
//Default Constructor
//You can Create object of this class in main() method
this.radius=0.0;
this.color="White";
this.filled=false;
}
Todo 3
this.radius=radius;
Todo 4 to Todo 6
super(color,filled); //invokes the parametrized constructor of parent class
this.radius=radius;
this.color=color;
this.filled=filled;
Todo 7
return ths.radius;
Todo 8
this.radius=radius;
Todo 9
return Math.PI()*this.radius*this.radius;
Todo 10
return 2*this.radius;
Todo 11
return 2*Math.PI*this.radius;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.