length = v2/(2*a)
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 2 ), and displays the minimum runway length.Solution:
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
double acceleration, speed, length;
System.out.print("Enter speed:");
speed = s.nextDouble();
System.out.print("Enter acceleration:");
acceleration = s.nextDouble();
length = (Math.pow(speed, 2))/(2*acceleration);
System.out.print("The minimum runway length for this airplane is " + length);
}
No comments:
Post a Comment