Advertisement
Guest User

oddscience question code 1

a guest
Nov 9th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. /**
  2.  * @author Jake
  3.  */
  4. public class Jumpcalc {
  5.  
  6.     /**
  7.      * @param args the command line arguments
  8.      */
  9.     public static void main(String[] args) {
  10.         // Figuring out the jerk.
  11.         double jerk = 1/1800.0; //average jerk
  12.         double acceleration = 10; //starting acceleration
  13.         double velocity = 0; //we start at a standstill
  14.         double position = 0; //on the surface of the earth
  15.         double time = 0; //time from drop
  16.         while(position < 8800000){ //number of meters to earth's core (roughly)
  17.            
  18.             System.out.println(position);
  19.             acceleration -= jerk;
  20.             velocity += acceleration;
  21.             position += velocity;
  22.             time++;
  23.         }
  24.         System.out.println(acceleration);
  25.         System.out.println(velocity);
  26.         System.out.println(position);
  27.         System.out.println(time);
  28.        
  29.     }
  30.    
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement