java.lang.NullPointerException
<p>Its get java.lang.NullPointerException everytime i run the program. Wouldn't even take any input. i really dont know why this is happening.</p>

<p>also, how much i have to explain this problem so stackoverflow will allow me to post this?</p>

<pre><code>import java.util.Scanner;
import java.text.DecimalFormat;

public class A1Q2 {

    Scanner keyboard = new Scanner(System.in); //declare scanner for keyboard input
    DecimalFormat twoDform = new DecimalFormat("#.##");//declare decimal format for closest cent

    double OP = 0; //original price of the car
    double IntM = 0; // store the value of mileage
    double FM = 0; //the mile age of the car
    double Age = 0; //the age of the car


    public static void main( String[] args) {
        // DECLARE VARIABLES/DATA DICTIONARY 

        // Read in the original values
        System.out.println("Please enter the original price of the car: ");
        OP = keyboard.nextDouble();// taking input for the original price

        //Read in the mileage factor
        System.out.println("Please enter the mileage factor as 0.7(high),1(average) and 1.2(low):");
        FM  = keyboard.nextDouble();// taking input for the general mileage of the car

        //Read in the age of cars
        System.out.println("Place enter the age of the car :");
        Age = keyboard.nextDouble();// taking input for the age of the car


        // Display the result, Call method to estimate the current price of the car
        System.out.println("Estimated price of the car is " +  Calculation( Age, FM, OP ) + " Dollers");

   }


   private String Calculation( double Age, double FM, double OP ) {

        // Declaration of the result variable 
        String EstPrice = "";

        //estimate the current price of the car
        EstPrice = twoDform.format(Math.sqrt(1.0 / (Age + 1)) * FM * OP);

        return EstPrice;
   }
}
</code></pre>
