Question: Write a class that defines a circle and its properties. You will need to download the Bounce,jar file and tell jGRASP where it is located.
GEEN 163 Bouncing Circles Create a class Circle that represents a round moving dot. A circle object needs to contain double variables to store the: Current X location of the circle's center Cument Y location of the circle's center Radius of the circle Direction of the circle's movement in radians Speed of the circle's movement The Circle class must contain a constructor Circle double x, double y, double radius) that initializes the circles center x,yand radius. The Circle class must provide the following methods: public double get Y "Returms the y coordinate of the center ofcircle. public void set Y( double vert set the y coordinate public double getX Returns the x coordinate of the center of circle. public void setX double horz set the x coordinate public double getspeed Returns the speed of the circle public void setSpeed double fast "Set the speed of the circle public double getDir Returns the direction of movement public void setDir( double compass "Set the direction of the circle in radians public double getRadius Returns the radius ofthis circle. public void move double time) Updates the x and y coordinates after the time Update the x coordinate to x cos( direction speed time Update the y coordinate to y sin( direction) speed time public boolean touches (Circle other True if the other circle touches this circle sum of the two circles radii. Your Circle class must contain the following main method: public static void main (Stringt unused) Bounce my Prog new Bounce You will need to download the Bouncejar file and tell jGRASP in Settings Classpath workspace Classpaths. Upload your completed Circle,java file to Blackboard
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
