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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started