# Program to determine Falling Distance

I've gone blank on writing this program. Any assistance will be greatly appreciated.
Java program will determine the distance an object falls within a specfic time period.  time should be displayed using seconds.  the given formula is: d= 1/2 gt2. Return the distance, in meters, and use values 1 thru 10 as arguments.  Here's what I have thus far, but a long way from where I should be, I think.
``````import java.util.Scanner;

public class Distance
{
public static void main(String args[])
{
double kilOmeters = 0;
double time = 0;
double speed = 0;
String input;

java.util.Scanner UserInput = new java.util.Scanner(System.in);

System.out.println("Enter Km: ");
kilOmeters=UserInput.nextDouble();

time = kilOmeters/60;
System.out.println("Time seconds = " + time);

}
}
``````
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

below is the code for your requirement
``````import java.util.Scanner;

public class Distance
{
public static void main(String args[])
{
double meters = 0;
double time = 0;
double gravity = 0;
String input;

java.util.Scanner UserInput = new java.util.Scanner(System.in);

System.out.println("Enter Time: ");
time=UserInput.nextDouble();
System.out.println("Enter Gravity: ");
gravity=UserInput.nextDouble();

meters = 0.5 * gravity * time * time;
System.out.println("Distance = " + meters);

}
}
``````
0

Experts Exchange Solution brought to you by