Question: Write this program in java with the following description: Circle color: String -radius: double PI-3.14159 +Circle( +Circle (radius:double colorString) +getColor:String +getRadius():double +setColor(String):void +setRadius(double):void +findArea():double +toSring):

Write this program in java with the following description:

Write this program in java with the following description: Circle color: String-radius: double PI-3.14159 +Circle( +Circle (radius:double colorString) +getColor:String +getRadius():double +setColor(String):void +setRadius(double):void +findArea():double

Circle color: String -radius: double PI-3.14159 +Circle( +Circle (radius:double colorString) +getColor:String +getRadius():double +setColor(String):void +setRadius(double):void +findArea():double +toSring): String +equals (Circle):boolean 1) From scratch, create a class called Circle using the UML class diagram given above. PI should be declared as a constant (for practice, use your own declared constant rather than Math P) The class contains two constructors- one that sets the data properties to the default (assume de fault radius is 1.0 and default color is blue) and a 2-arg constructor that sets the data properties to the values passed in To calculate the area of a circle, use the fomula: area radius PI . The toString method wl have nothing passed to it and return a string that can be used within a println statement to display the data properties of a given Circle object in the format shown below (one decimal on all values). No println's within the toString method! Color: red Radius: 5.0 Area: 78.5 The equals method will return true if the color and radius of the calling object (this) is the same as the color and radius of the circle passed to the method (other), otherwise retums false. Method signature: public boolean equals (Car other) Invoking the Method: if (circlel.equals(circle2))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!