A Circle will have a radius. The class will be able to keep track of the number of Circle objects created. It will also hold the total of the circumferences of all the Circle objects created. It will allow a client to create a Circle, passing in a double value for the radius into the Circle constructor. If the value for the radius that is passed in is 0 or negative, then the radius will be set to a value of 999. The constructor should add 1 to the count of the number of Circles created. The constructor should call a method to calculate the circumference and then add the circumference for that object to an accumulator. In addition to the constructor, the Circle class must have the following methods that return a boolean value: isCongruent(Circle c) – Compares two Circle objects to determine if they are congruent (radii are equal). isValid() – the radius may not be 0 or negative. equals (Triangle t) – compares two Triangle objects to determine if they are equal. We will compare their circumferences to determine equality. Additional methods in the Circle class toString() – returns a String that specifies the value of the radius calcCircumference() – calculate and return the circumference of the object. calcArea() – calculate and return the area of the object addTotalCircumference(). This method will call calcCircumference() and add the circumberence for that object to an accumulator. reduceTotalCircumference(). This method should subtract the circumference for that object from the accumulator. Accessor methods for all properties.
Class Circle
A Circle will have a radius. The class will be able to keep track of the number of Circle objects created. It will also hold the total of the circumferences of all the Circle objects created.
It will allow a client to create a Circle, passing in a double value for the radius into the Circle constructor.
-
If the value for the radius that is passed in is 0 or negative, then the radius will be set to a value of 999.
-
The constructor should add 1 to the count of the number of Circles created.
-
The constructor should call a method to calculate the circumference and then add the circumference for that object to an accumulator.
In addition to the constructor, the Circle class must have the following methods that return a boolean value:
-
isCongruent(Circle c) – Compares two Circle objects to determine if they are congruent (radii are equal).
-
isValid() – the radius may not be 0 or negative.
-
equals (Triangle t) – compares two Triangle objects to determine if they are equal. We will compare their circumferences to determine equality.
Additional methods in the Circle class
-
toString() – returns a String that specifies the value of the radius
-
calcCircumference() – calculate and return the circumference of the object.
-
calcArea() – calculate and return the area of the object
-
addTotalCircumference(). This method will call calcCircumference() and add the circumberence for that object to an accumulator.
-
reduceTotalCircumference(). This method should subtract the circumference for that object from the accumulator.
-
Accessor methods for all properties.

Trending now
This is a popular solution!
Step by step
Solved in 2 steps









