Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this problem I need help on jGrasp Java format, the circle object has to be set to double variables to store the X, Y
In this problem I need help on jGrasp Java format,
the circle object has to be set to double variables to store the X, Y locations, raidus of circle, direction, and speed of circle.
Mutiple public classes are made in this problem but im not sure how to solve it
We use the file: BounceFX.jar and place this in our classpath feature to embed the jar file in the program
COMP163 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 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 () public void setSpeed ( double fast Set the speed of the circle */ public double getDir () public void setDir double compassSet the direction of the circle in radians*/ public double getRadius () * 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*/ * Returns the direction of movement* Returns the radius of this circle,* /* Updates the x and y coordinates after the time */ 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 public boolean touches Circle otherTrue if the other circle touches this circle */ True if the distance between the centers of the two circles, V(xi - x2)2 + (y1 - 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 completed Circle.java file to BlackboardStep 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