Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a computer program that computes the duration of a projectile\'s flight an

ID: 3650210 • Letter: W

Question

Write a computer program that computes the duration of a projectile's
flight 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

I did all this , but there is some error, please make any correction
#include <math.h>

#define PI 3.14159265

int main ()
{
double theta, time,velocity,height,distance;
double G =32.17 ;

printf(" Enter the value for Theta: ");

scanf("%lf",&theta);

printf(" Enter the Velocity : ");

scanf("%lf",&velocity);

printf(" Enter the distance : ");

scanf("%lf",&distance);

time = distance / (velocity * cos (theta*PI/180) ) ;

height = (velocity *sin(theta*PI/180)*time) - ( G*(time) );

printf(" Height = %lf feet time = %lf seconds ",height,time);

return 0;
}

Explanation / Answer

#include #define PI 3.14159265 int main () { double theta, time,velocity,height,distance; double G =32.17 ; printf(" Enter the value for Theta: "); scanf("%lf",&theta); printf(" Enter the Velocity : "); scanf("%lf",&velocity); printf(" Enter the distance : "); scanf("%lf",&distance); time = distance / (velocity * cos (theta*PI/180) ) ; height = (velocity *sin(theta*PI/180)*time) - ( G*(time) ); printf(" Height = %lf feet time = %lf seconds ",height,time); return 0; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote