Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN JAVA This is the question, and you must also have a visual representation. Thank you. use the draw module to draw the visual representation
IN JAVA This is the question, and you must also have a visual representation. Thank you. use the draw module to draw the visual representation of the cannonball firing.
Cannonball Design a class Cannonball to model a cannonball that is fired into the air. A ball has An x- and a y-position An x-and a y-velocity. Supply the following methods A constructor with an x-position (the y-position is initially 0). .A method move(double deltaSec) that moves the ball to the next position. First compute the distance traveled in deltaSec seconds, using the current velocities, then update the x and y-positions; then update the y-velocity by taking into account the gravitational acceleration of -9.81 m/s2; the x-velocity is unchanged. .A method Point getLocation() that gets the current location of the cannonball, rounded to integer coordinates A method ArrayListStep 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