CircleTester - circle1.setX-3.0 circle1.setY(4.0 c print...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************* // // // // A client to test the functionality of objects // of the class Circle // //******************************************************* public class CircleTester{ p public static void main(String[] args) { p Circle circle1= new Circle(0.0,0.0,2); Circle circle2= new Circle(2.0,1.0,1); C System.out.println("circle1="+circle1); System.out.println("circle2="+circle2); S // If the method setRadius is implemented correctly, // a call to setRadius with a negative number // will not change the value of the circle's radius. // circle1.setRadius(-2.0); c // // Reset the center of circle1 (-3.0,4.0)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // circle1.setX(-3.0); circle1.setY(4.0); c // print circle1 characteristics (center and radius), use a statement similar // to the previous println statements. Note that is not necessary to call //the method toString, why? / // set the circle2 radius to 5.3 / // print circle2 characteristics (center and radius), use a statement similar to first and // second println statements / // print circle1 diameter, area and perimeter / // print circle2 diameter, area and perimeter / // display whether circle1 is a unit circle / // display whether circle2 is a unit circle / } }...
View Full Document

  • Fall '10
  • Storm
  • new Circle, public static void, public class CircleTester, previous println statements, print circle1 diameter

{[ snackBarMessage ]}

Ask a homework question - tutors are online