Question: If a projectile is fired or thrown upwards at a known velocity, its entire trajectory can be accurately computed. You probably remember the physics formula

If a projectile is fired or thrown upwards at a known velocity, its entire trajectory can be accurately computed. You probably remember the physics formula h = v t g t 2 (h is the projectiles height at any given time, v is the initial upwards velocity, t is the time elapsed since it was fired or thrown, and g is the acceleration due to gravity, an approximate constant anywhere on the surface of the earth). If you measure h in feet, t in seconds, and v in feet per second, g is about 32.174. Obviously this is going to be a very important formula for this program. One of the most important aspects of good programming is to make separate functions for all the important things. So make a good start: write a clear and simple function that takes values for v and t as parameters, and calculates and returns the corresponding value of h. Think about what types the parameters and other constants should have for an accurate calculation. Test your function thoroughly. It may be difficult to think of good values for testing. If you remember calculus you can work things out exactly, but velocities between 100 and 200 feet per second should keep the cannon ball in the air for a few seconds. The exact formula for how long the ball stays in the air, when there is no atmosphere to slow it down is (2 v / g) seconds.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!