1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
omeli [17]
4 years ago
6

Write the ColorfulBouncingCircle class, where you should write the constructor, setPlayingFieldSize, and tick methods, and overr

ide the overlaps method, each according to the above descriptions. You should not have to write any code which draws; instead, a test program will be provided which will animate ColorfulBouncingCircles based on your implementation. For every time tick, the test program will compare every circle against every other circle using the overlaps method
Computers and Technology
1 answer:
Keith_Richards [23]4 years ago
4 0

Answer: Circle class representing circle objects which have a radius, center x, and center y. It included overlaps and draw methods. Then, we wrote a Colorfulcircle class which included a Color property and overrode the draw method of Circle. For this assignment, you are asked to create a ColorfulBouncing circle class. Begin with the versions of Circle and ColorfulCircle uploaded to Canvas ColorfulBouncingCircle should extend ColorfulCircle, Unlike the other Circle classes, it will include a velocity for the x and y axes. The constructor for ColorfulBouncingCircle includes these parameters: public colorfulBouncingcircle (double radius, double centerx, double center Color color, double xVelocity, double yvelocity) Note that we are treating x as increasing to the right and y as increasing down, as with Java's graphics coordinates system. This was also seen with Circle's draw method. ColorfulBouncingCircles will bounce around in a playing field which the tester will provide. The Colorful Bouncinesicle class should have a public static method to set the playing field width and height: public static void setPlayingFieldsize (double newwidth, double newHeight) ColorfulBouncingCircle will also include a method which should alter its center and center with each time tick (similar to a metronome's noise guiding a musician to play a song). The circle's x position should be altered according to x velocity and y position according to y velocity. However, before changing the positions, check if the center position would, after moving, be either less than 0 or greater than the playing field dimensions. If so, instead of changing the center position, alter the velocity. If the ball hits the top or bottom, the sign of its vertical velocity should be flipped: if it hits the left or right, its horizontal velocity sign should be flipped. If it hits a corner, both should be. Notice that velocity may be positive or negativel The tick method which will be called by the tester is defined in this way:

public void tick() Finally, we should override the overlaps method to make balls bounce away from each other. You should call the super method to see if your circle overlaps another circle. If so, alter this circle's velocity according to its center relative to the other circle. If this circle" is above or below the "other circle," flip the sign of "this circle's" vertical velocity. If it's to the left or right, flip the horizontal velocity As before, both may be flipped. This is NOT the same as a true elastic collision, but it should be simpler for you to implement. The sign flipping will sometimes cause the balls to "vibrate" when caught between each other. Please review the velocity changing rules carefully; they are easy to get wrong!! To review: Write the ColorfulBouncineCircle class, where you should write the constructor setPlayingfield Size, and tick methods, and override the overlaps method, each according to the above descriptions. You should not have to write any code which draws; instead, a test program will be provided which will animate ColorfulBouncingCircles based on your implementation. For every time tick, the test program will compare every circle against every other circle using the overlaps method. The test program will ask you to press Enter in the console to launch the automated tests which will assign a tentative score based on your implementation. DO NOT ALTER the Circle OR Colorful Circle files!!

Explanation:

You might be interested in
Manny has drafted an email message and configured a delivery option "Do not deliver before: 5:00 P.M. and today's date." He shut
diamong [38]

Answer:

The Email will send.

Explanation:

The email will send as long as there is internet connection.

6 0
3 years ago
Assume that you want to create an array containing ten Die objects. Which of the following code segment accomplishes this correc
V125BC [204]

Answer: A

To create an array containing 10 die object we have:

Die[]dice=new die[10]; for (int I=0; i<dice,length; i++){dice[I]=new die();}

8 0
4 years ago
Who can effectively use website authoring software?
Vedmedyk [2.9K]
<span>When a word porcessing program user formats a document, what does the user changes? ... worksheet.Who can effectively use web page authoring software?</span><span>
</span>
6 0
4 years ago
In which step is a metaphor used in planning a multimedia presentation
bulgar [2K]

Metaphors are considered in a presentation as a statement that considers one idea in terms of another. This literary use has a deeper function as it entertains and motivates our minds. Therefore, metaphors are a great tool in presentations. They help with simplifying ideas, and make concepts easier to understand.  Metaphors bring a creative touch to the content of the presentation, as well. Especially in multimedia, where you have visual metaphors to stir up the audiences senses t the content being presented.

6 0
3 years ago
A wireless networking technician has completed a survey of a wireless network and documented the detected signal strengths in va
katrin [286]

Answer:

Heat Map

Explanation:

According to my research on information technology, I can say that based on the information provided within the question the document being described is known as a Heat Map. This shows the signal strengths of wireless networks in different locations, and are used to fix networking problems as well as improve performance.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

4 0
3 years ago
Other questions:
  • Before text can be formatted you must first
    10·2 answers
  • What is a collection?
    5·1 answer
  • The critical path in a project network is:______ A. The Shortest path through the network. B. Longest path through the network.
    8·1 answer
  • Design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorit
    13·1 answer
  • Sukant’s professor asks her to take over his online class while he is away because she is an effective digital communicator. Whi
    11·2 answers
  • Your computer crashed, and you lost many personal and work-related files. You just got a new computer, but you are now much more
    8·2 answers
  • The advantage of an electronic ____ is that the content can be easily edited and updated to reflect changing financial condition
    8·1 answer
  • What is Brainly?<br><br> A.Yes<br> B.No
    12·2 answers
  • Betty was sitting at a coffee shop reading her favorite book. She heard an explosion nearby. In a few, she could hear ambulance
    7·2 answers
  • Which of the following is a quality of a mixed economy?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!