Write a program that prompts the user to enter v in meters/second (m/s) and the acceleration a in meters/second squared (m/s²), and displays the minimum runway length.
speed v, you can compute the minimum runway length needed for an airplane to take
off using the following formula:
length = v²/2a
Write a program that prompts the user to enter v in meters/second (m/s) and the accel-
eration a in meters/second squared (m/s²), and displays the minimum runway length.
#Beginner
In gcc c++ compiler using namespace std;
#include<iostream>
using namespace std;
int main()
{
float speed,acceleration,length;
cout<<"Enter speed and acceleration :";
cin>>speed>>acceleration;
length=(float)(speed*speed)/(2*acceleration);
cout<<"The minimum runway length for this airplane is :"<<length;
return 0;
}
Output
Enter speed and acceleration :60 3.5
The minimum runway length for this airplane is :514.286
[Program finished]
Comments
Post a Comment
Any doubt about programming or questions