# Physics: Finding Runway Length

The program below is the answer to Liang's Introduction to Java Programming (9th Edition) Chapter 2 Exercise 2.12. ```/**
*
* @Author: Aghatise Osazuwa
* Website: www.cscprogrammingtutorials.com
*
* Exercise 2.12 - Physics: Finding Runway Length
*
*/

import java.util.Scanner;

public class RunwayLength {

public static void main(String[] args) {

//Display Program Information
System.out.println("This Program Calculates The Minimum Runway Length "
+ "Needed For An Airplane To Take Off.\n");

//create Scanner
Scanner input = new Scanner(System.in);

//prompt user to enter details
System.out.println("Enter speed (in meters per second) and "
+ "acceleration (in meters/second squared):");
double speed = input.nextDouble();
double acceleration = input.nextDouble();

//calculate length
double length = ((speed * speed) / (2 * acceleration));

//format length to 4 decimal places
length = (int)(length * 10000) / 10000.0;

//display the result
System.out.println("The minimum runway length for this airplane is "
+ length + "\n");
}
}
```

Click here to see other solutions to Introduction to Java Programming.