Question: Help, I figure out what is wrong with the program. Output 2.12) Write a C program that does the following: Asks user for jet's take-off

Help, I figure out what is wrong with the program.

Help, I figure out what is wrong with the program. Output 2.12)

Write a C program that does the following: Asks user for jet's

Output

take-off speed (km/hr) and the distance (meters) over which the catapult accelerates

2.12) Write a C program that does the following: Asks user for jet's take-off speed (km/hr) and the distance (meters) over which the catapult accelerates the jet from rest to take-off. The program then calculates the acceleration (m/s^2) of a jet fighter launched from an aircraft-carrier catapult. Assume constant acceleration. It also calculates the time (seconds) for the fighter to be accelerated to take-off speed. Relevant formulas: velocity = acceleration * time distance = (1/2)*acceleration time^2 Hint: You may want to substitute the formulas for unknown as such: C = a*b; b = a*c hence c = a*a*c; Also make sure to convert km/hr to m/s. Note: Your output should have 2 places of precision. SAMPLE RUN #4: . / JetSpeed Interactive Session Hide Invisibles Highlight: None Show Highlighted Only O Enter.jet's take-off.speed.in-km/hr:102.2- Enter.distance in meters.required to reach take-off speed:74- Acceleration.of.jet.is.5.45.m/s^2- Time-required.is.5.21. seconds float t; #include 2 #include 4 int main(){ double v; double distance; 7 8 float a; 9 printf("Enter jet's take-off speed in km/hr:"); 10 scanf("%f", &v); 11 printf("Enter distance in meters required to reach take-off speed: "); 12 scanf("%f",&distance); 13 14 1/converting KM/h to m/s 15 v = (v*5)/18; 16 17 18 a = pow(v,2)/(2*distance); 19 t = v/a; 20 21 a = floor(100*a)/100; 22 t = floor (100*t)/100; 23 24 printf("Acceleration of jet is $0.2 m/s^2 ", a); 25 printf("Time required is %0.2f seconds ",t); 26 27 } Failed Test Run The contents of your standard output is incorrect. Interactive Session - W Hide Invisibles) Highlight: None Show Highlighted Only O Expected Result: Enter.jet's take-off.speed.in.km/hr:102.2- Enter.distance in meters.required to reach take-off.speed:744 Acceleration of.jet.is.5.45.m/s^2- Time required.is.5.21. seconds Your Code's Actual Result: Enter.jet's take-off.speed.in.km/hr:102.2- Enter.distance.in.meters.required to reach take-off.speed: 742 Acceleration of jet.is.5.44.m/s^24 Time required.is.5.21. secondse

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!