Projectile Motion
|
/* This program determines the maximum height and time taken to reach that height for an object propelled straight up at a given velocity */ class Time2 { public static void main(String args[]) { System.out.println("\n"); System.out.println("This program determines the maximum height and time taken to reach that height for an object propelled straight up at a given velocity."); System.out.println(); System.out.println("m stands for meters, s stands for seconds, m/s stands for meters per seconds."); double fvelocity,ivelocity,time,gravity,iposition,fposition; gravity = -9.81; fvelocity = 0; ivelocity = 1; iposition = 0; System.out.println("\n"); System.out.println("Velocity \t \t Time \t \t \t Vertical Distance"); System.out.println("\n"); for(ivelocity=1; ivelocity <= 100; ivelocity++) { time=(fvelocity - ivelocity)/gravity; fposition=(.5)*(gravity)*(time * time) + (ivelocity * time) + iposition; System.out.println(ivelocity+ " m/s"+ "\t \t" +time+ " s"+ "\t \t" +fposition+" m"); } } } |
|
Results This program determines the maximum height and time taken to reach that |