Write a computer program that computes the duration of a projectile\'s flight an
ID: 3650199 • Letter: W
Question
Write a computer program that computes the duration of a projectile'sflight and its height above the ground when it reaches the target. As
part of your solution, write and call a function that displays instruc-
tions to the program user.
Problem Constant
G = 32.17 // gravitational constant
Problem Inputs
float theta // input - angle (radians) of elevation
float distance // input - distance (ft) to target
float velocity // input - projectile velocity (ft/sec)
Problem Outputs
float time // output - time (see) of flight
float height // output - height at impact
Relevant Formulas
time= distance/(velocity * cos(theta))
g x time2
height = (velocity x sin(theta) x time )-{ (g * time^2)/2}
Try your program on these data sets.
Inputs Data Set 1 Data Set 2
Angle of elevation 0.3 radian 0.71 radian
Velocity 800 ft/sec 1,600 ft/ sec
Distance to target 11,000 ft 78,670 ft