write a program that calculates the acceleration (m/s^2) of a jet fighter launch
ID: 3628156 • Letter: W
Question
write a program that calculates the acceleration (m/s^2) of a jet fighter launched from an aircraft-carrier-based catapult, given the jet's takeoff speed in km/hr and the distance (meters) over which the catapult accelerates the jet from rest to takeoff. Assume constant acceleration. Also calculate the time (seconds) for the fighter to be accelerated to takeoff speed. when you prompt the user, be sure to indicate the units for each input. For one run, use a takeoff speed of 278 km/hr and a distance of 94 metersRelevant formulas (v=velocity, a=acceleration, t=time, s=distance)
v=at
s=1/2at^2
Explanation / Answer
#include int main(int argc, char* argv[]) { float takeoffSpeed; /* km/hr at takeoff */ float distance; /* meters from rest to takeoff */ /* prompt user to enter values */ printf("Please enter the values as prompted. "); printf("Takeoff speed (km/hr)? "); scanf("%f", &takeoffSpeed); printf("Distance of catapult acceleration (m)? "); scanf("%f", &distance); takeoffSpeed *= 1000; /* convert takeoff speed into m/s */ /* plug t = v/a into s = (1/2)at^2 = (1/2)av^2/a^2 = (1/2)v^2/a */ /* solve for a to obtain a = (1/2)v^2 / s */ float acceleration = 0.5 * takeoffSpeed * takeoffSpeed / distance; /* solve v=a*t for t, to obtain t = v/a */ float time = takeoffSpeed / acceleration; printf("Acceleration rate is %f m/s^2 ", acceleration); printf("Acceleration time is %f s ", time); } Please enter the values as prompted. Takeoff speed (km/hr)? 278 Distance of catapult acceleration (m)? 94 Acceleration rate is 411085120.000000 m/s^2 Acceleration time is 0.000676 sRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.