/**
 *           DoubleExample. Simple example of using double variables to
 *           perform simple calcualtions. 
 */

public class DoubleExample {                  // Define class
    public static void main(String args[]) {  // Sart of main program

	double gravity = 9.81;   // Double with value specified by double
	double time = 10;        // Double with value specified as int

	double velocity = gravity*time;   // Double with value specified by equation  
	double distance;                  // Double with NO specified value
	distance = 0.5*gravity*time*time; // Set the value of double with equation.

	//         Print out the values (more on this in the next section)

	System.out.println("At 10 second");
	System.out.println("Velocity is " + velocity);
	System.out.println("Distance is " + distance);


	time = time + 20;              // Add 20 to the current value of time

	//               Recalcualte vectocity and distance with the NEW value
	//               of time.

	velocity = gravity*time;                  // Recalculate velocity
	distance = 0.5*gravity*time*time;         // Recalculate distance

	//                Print out the new values

	System.out.println("At 30 second");
	System.out.println("Velocity is " + velocity);
	System.out.println("Distance is " + distance);
	
    }
}
	

	
