2.12(物理:求出跑道长度)编写程序,提示用户输入以米/秒为单位的速度v和加速度a,然后显示最短跑道长度
import java.util.Scanner; public class Q2_12 { private static double lengthOfPane(double v,double a){ return (v*v)/(2*a); } public static void main(String[] args) { System.out.println("Enter speed and acceleration: "); Scanner input = new Scanner(System.in); double v = input.nextDouble(); double a = input.nextDouble(); System.out.println("The minimum runway for this airplane is "+lengthOfPane(v,a)); } }