Advertisement
liwgfr

Untitled

Sep 16th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5. public class Solution {
  6.     public static void main(String[] args) throws IOException {
  7.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  8.         System.out.println("Input the number of seconds with 2 digits after decimal point");
  9.         String z = reader.readLine();
  10.         double t = Double.parseDouble(z);
  11.         float g = 9.81f;
  12.         float h = (float) ((g * t * t) / 2);
  13.         h = Math.round(h * 100.0 / 100.0);
  14.         System.out.println("Depth of well = " + h + " meters");
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement