Question: Circle.java: 1. Create a class named Circle, include a field for radius. - Include a default constructor that sets the radius to 0. - Include

Circle.java:

1. Create a class named Circle, include a field for radius. - Include a default constructor that sets the radius to 0. - Include setRadius() and getRadius() methods. - The setRadius() methood sets the radius, also calculates the following methods: setCircumference(), setArea(), setDiameter (using the Math.PI constant) - Add a toString() to display current state of the object, include in the state of the radius, diameter, area, and circumference of a cirlce (DO NOT create attributes for the diameter, area, and circumference).

CircleDriver.java 2. Create a class named CircleDriver that includes the main() method. - Add two Circle objects - Include a determineLargerCircle() method - displays the larger of two circle objects (pass the circle objects into this method from main() ). - Include a getACircle() method - reads the radius of the circle from the input file (one by one), call this method twice from main() and return the circle object back to main() - Include a displayACircle method - displays current state of the circle object, including radius, diameter, area, and circumference.

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!