Run way Length
Run way Length
Problem Description
Write a program to calculate the minimum runway length for this airplane and the formula to calculate is as follows:
length=((speed * speed) / (2 * acceleration));
Input:
1. Speed
2. Acceleration
Output:
Runway length
Note: Use Double data type
Solution
import java.util.Scanner;
import java.io.*;
public class TestClass {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int speed= sc.nextInt();
int accelaration= sc.nextInt();
float length= ((speed*speed)/(2*accelaration));
System.out.println(+length);
}
}
0 Comments