Write a program
that prompts the user to enter v in meters/second (m/s) and the
acceleration a
in meters/second squared (m/s2),
and displays the minimum runway
length
Description:
By using formula length =/2a
Solution
import java.util.*;
public class Message {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
float a,v;
System.out.println("Enter
the acceleration");
a=in.nextFloat();
System.out.println("Enter
the velocity");
v=in.nextFloat();
System.out.println("The
minimum lenght of runway is "+((v*v)/(2*a)));
}
}
Output:
No comments:
Post a Comment