Instead of dropping a watermelon from a building, let’s shoot it from a cannon and compute its projectile. The (x, y) coordinates of a watermelon at time t are
where g is the acceleration of gravity, V is the initial velocity, and (alpha) is the initial angle. The acceleration of gravity on earth is 9.8 m/s2.
Write an application that inputs an initial velocity V (m/s) and an initial angle alpha (degrees) and computes the projectile of a watermelon cannon ball. The program should repeat the computation until the user wants to quit. The program outputs the (x, y) oordinate value for every second, that is, t = 0, 1, 2, and so forth. The program stops the output when the y value becomes 0 or less. To use the cos and sin methods of the Math class, don’t forget that you have to convert the input angle given in degrees to radians. You can convert a degree to equivalent radians by using the following
or calling the toRadians method of the Math class. Note: Air resistance is not considered in the formula. Also, we assumed the watermelon will not get smashed upon firing.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.