Question: In java complete the following Create a class Circle that represents a round moving dot. A circle object needs to contain double variables to store

In java complete the following  In java complete the following Create a class Circle that represents

Create a class Circle that represents a round moving dot. A circle object needs to contain double variables to store the Current Xloca tion of the circle's center e Current 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, y and radius. The Circle class must provide the following methods public double getY () public void sety( double vert ) public double getx () public void setX( double horz) public double getSpeed () Returns the y coordinate of the center of circle./ set the y coordinate Returns the x coordinate of the center of circle. set the x coordinate Returns the speed of the circle public void setSpeed ( double fast ) Set the speed of the circle public double getDir public void setDirdouble compassSet the direction of the circle in radians public double getRadius ) public void move( double time) Update the x coordinate to x + cos( direction) speed *time Update the y coordinate to y +sin( direction) speed time Returns the direction of movement Returns the radius of this circle. Updates the x and y coordinates after the time/ public boolean touchesCircle otherTrue if the other circle touches this circle/ True if the distance between the centers of the two circles,xx2)2 + (Vi-y2)2 is less than the sum of the two circles radii Your Circle class must contain the following main method: public static void main (String[] unused) ( Box.animate ) You will need to download the BounceFX.jar file and tell jGRASP in Settings/ Classpath/workspace / Classpaths. Upload your com pleted Circle java file to Blackboard

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!