To practice my basic programming skills over the summer I decided to write a 1dimensional motion physics problem solver. I am getting a java.lang.Nullpointerexception error whenever I try to run the program. I can't figure out what I've written incorrectly to give me the error. NOTE: Right now I am assuming the input for the solveFor variable will be "acceleration" for the sake of fixing this error:
import java.util.Scanner;
public class PhysicsProblem
{
private double vI; // initial velocity  
private double vF; // final velocity    
private double t;  // time 
private double deltaX;  // change in the x value
private double accel;
private String missingVar;
public PhysicsProblem (double acceleration, double initialV, double finalV, double time, double changePosition) 
{
    acceleration = accel;
    initialV = vI;
    finalV = vF;
    time = t;
    changePosition = deltaX;    
}
Scanner scan = new Scanner(System.in);
public void getUnknownsAccel()
{
    //-----------
    // checks for another unknown value that is not accel
    //-----------
    if (missingVar.equalsIgnoreCase("time"))
    {
        System.out.println("Please enter the value for time: ");
        t = scan.nextDouble();
        while (t <= 0 || !scan.hasNextDouble())
        {
            System.out.println("That is not an acceptable value!");
            t = scan.nextDouble();
        }
    }       
    if (missingVar.equalsIgnoreCase("initial velocity"))
    {
        System.out.println("Please enter the value for initial velocity: ");
        vI = scan.nextDouble();
        while (!scan.hasNextDouble())
        {
            System.out.println("That is not an acceptable value!");
            vI = scan.nextDouble();
        }
    }
    if (missingVar.equalsIgnoreCase("final velocity"))
    {
        System.out.println("Please enter the value for final velocity: ");
        vF = scan.nextDouble();
        while (!scan.hasNextDouble())
        {
            System.out.println("That is not an acceptable value!");
            vF = scan.nextDouble();
        }
    }
    if (missingVar.equalsIgnoreCase("delta X"))
    {
        System.out.println("Please enter the value for delta X: ");
        deltaX = scan.nextDouble();
        while (!scan.hasNextDouble())
        {
            System.out.println("That is not an acceptable value!");
            deltaX = scan.nextDouble();
        }
    }
}
This is the class file for the program. I'm getting an error in the line 36: "if (missingVar.equalsIgnoreCase("time"))"
As well as getting an error in line 40 of the main program body: "problem1.getUnknownsAccel();"
public static void main (String[] args)
{
    String missingVar;      // other missing variable
    double vI = 0;
    double vF = 0;
    double t = 0;
    double deltaX = 0;
    double accel = 0;
    Scanner scan = new Scanner(System.in);
    PhysicsProblem problem1 = new PhysicsProblem (accel, vI, vF, t, deltaX);
    System.out.println("Which variable are you solving for? ");
    String solveFor = scan.nextLine();
    // after receiving solveFor input, assesses data accordingly
    if (solveFor.equalsIgnoreCase("acceleration"))
    {
        System.out.println("Solving for Acceleration!");
        System.out.println("Are there any other unknowns? (enter 'none' or the name " +
                "of the variable)");
        missingVar = scan.nextLine();
        do
        {
            problem1.getUnknownsAccel();
            System.out.println("Are there any other unknowns? (enter 'none' or the name " +
                    "of the variable)");
            missingVar = scan.nextLine();
        }   
        while (!missingVar.equalsIgnoreCase("none") || !missingVar.equalsIgnoreCase("acceleration"));
        if (missingVar == "none");
        {
            // Write code for finding solutions
            System.out.println("Assuming you have given correct values, the solution is: ");
        }
    }
Why is it throwing an exception?
 
     
     
    