If you shoot a cannon, how far will the cannon ball go before it hits the ground? How high will it go?

- All input and output data is in feet/seconds/degrees
- The acceleration of gravity is 32 feet/sec/sec (9.8 meters/sec/sec)
- There is no air resistance to slow the cannonball
- The earth is flat (no curvature)
- Ignore the rotation of the earth
- Ask the user for:
- The cannon's angle above the horizon

*Do not allow angles less that 20° or greater than 90°* - The muzzle velocity of the cannon

*Do not allow velocities (less that 10 feet/sec or greater than 2000 feet/sec?)*

- The cannon's angle above the horizon
- Display
- Cannonball flight time (seconds)
- Horizontal distance traveled (feet)
- Maximum vertical distance (feet)

Input

Horizontal and Vertical VelocityV _{m}// muzzle velocity (feet/sec) A // cannon elevation angle (degrees)

Time (seconds) to the top of the arc (zero vertical velocity)V _{v}= sin(A) * V_{m}// vertical velocity (feet/sec) V_{h}= cos(A) * V_{m}// horizontal velocity (feet/sec)Note: Depending on which programming language you use, you may need to convert angles in degrees to radians. For example, the Python sin and cos functions require radians. Radians = Degrees x Pi / 180 (Pi is approximately 3.14159) (1 radian is approximately 57.296 degrees) (1 degree is approximately 0.0174532925 radians)

Total time (seconds) of flight - up and then downT _{top}= V_{v}/ 32.0Note: 32.0 = acceleration of gravity (feet/sec/sec)

Horizontal distance (feet)T _{total}= 2 * T_{top}

Vertical distance (feet) to top of arc (zero vertical velocity)D _{h}= T_{total}* V_{h}

D _{v}= (V_{v})^{2}/ (2 * 32.0)Note: 32.0 = acceleration of gravity (feet/sec/sec)

*Note: Go
here for more information on the calculation*

Plot the cannonball's trajectory.