public class Circle { // Declare the instance data - be sure to use the appropriate visibility modifier // Constructor - takes three int parameters for the x and y coordinates // of the circle and the radius and uses them to initialize the circle. // getRadius - returns the radius // area - computes and returns the area of the circle (type double) // resize - takes one parameter of type int representing the // amount to change the size of the radius; the radius is changed // by that amount // move - takes two parameters of type int representing the amount // to move the circle in the horizontal and vertical directions; // the center is moved by the amounts passed in. // toString - returns a string representation of the circle }
public class CircleTest { // Use some methods in the Circle class to test them public static void main (String[] args) { // Declare and instantiate a Circle object with center at // the point (13, 4) and radius 20. (Name your object testCircle) // Write a statement that prints the area of the circle (invoke // the area method in your print statement) // Write a statement that increases the radius of testCircle by 5. // Write a statement that prints the new radius of the circle // (invoke the getRadius method in your print statement). // Write a statement that moves the circle by adding -5 to the // x coordinate and 8 to the y coordinate. Use the move method. // Write a statement that prints the testCircle object } }