197k views
0 votes
Write a C++ program that prompt the user to enter v in meter/second(m/s) and the acceleration in a in meters/second squared (m/s^2), and displays the minimum runway length.

1 Answer

7 votes

Answer:

following are the code in c++

#include<iostream> // header file

#include<math.h>

using namespace std;

int main() // main function

{

double v,a,len;// declaring variable

cout<<" Enter v: ";

cin>>v;

cout<<" Enter a:";

cin>>a;

len=pow(v,2)/(2*a); // to calculate the minimum runway length.

cout<<" The minimum runway length is :";

cout<<len;

return 0;

}

Step-by-step explanation:

In this program we taking two user input in the variable v and a respectively.After that we using the formula len=v*v/2*a to calculate the minimum runway length and finally print len which display the minimum runway length. .

output

Enter v: 60

Enter a: 3.5

The minimum runway length is :514.286

User George Oiko
by
6.3k points