Question: In java mathmatically, and visually represent a cannon ball shooting. (Without importing any packages) Cannonball Design a class Cannonball to model a cannonball that is
Cannonball Design a class Cannonball to model a cannonball that is fired into the air. A ball has An x-and a y-position Anx- 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 thex- 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 ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
