title: Initialization and FileNotFoundException errors
body: <p>I am a new Java student and am writing a program that consists of a main method, a class file, two input .txt files, and an output.txt file. The main method should ask the user what the account balance and annual interest is and import deposit and withdrawal information from their respective files, and then to display all calculations from the class file in an output file.
  I had originally written this file to ask users for all of this input using the scanner and now I'm trying to get it to work using files as input...which is not going so well.</p>
  
  <p>Main method:</p>
  
  <pre><code>    import java.util.Scanner;
      import java.io.*;
      public class SavingsAccountDemo {
  
     public static void main(String[] args) {
     //declare variables
     double interest;
     double startAmount;
     double amountDeposit;
     double amountWithdraw;
     double d, w;
     String filenameInputW, filenameInputD, filenameOutput;
     PrintWriter oFile;
     File wFile, dFile;
     Scanner iFile;
  
     Scanner key = new Scanner(System.in);
  
      //get initial balance
     System.out.println("Enter initial account balance: ");
     startAmount = key.nextDouble();
  
     //create SavingsAccount class object sending starting amount to constructor
     SavingsAccount money = new SavingsAccount(startAmount);
  
     //get annual interest rate
     System.out.println("Enter annual interest rate: ");
     interest = key.nextDouble();
  
     //send interest rate to class
     money.setInterest(interest);
  
     //Retrieve withdrawals from withdrawal.txt
     filenameInputW="withdrawal.txt";
     wFile = new File (filenameInputW);
     iFile = new Scanner (wFile);
     while(iFile.hasNext())
     {
          double num;
  
          num=iFile.nextDouble();
          amountWithdraw += num;
  
          if(amountWithdraw &gt;= 0.1)
          w++;
     }
  
     //send to SavingsAccount class
      money.withdraw(amountWithdraw);
  
     //Retrieve deposits from deposit.txt
     filenameInputD="deposit.txt";
     dFile = new File (filenameInputD);
     iFile = new Scanner (dFile);
  
     while(iFile.hasNext())
     {
          double num;
  
          num=iFile.nextDouble();
          amountDeposit += num;
  
          if (amountDeposit &gt;= 0.1)
          d++;
     }
  
     //send to SavingsAccount class
      money.deposit(amountDeposit);
  
     //display retults
     filenameInputW="output.txt";
     oFile=new PrintWriter (filenameOutput);
     oFile.println("The ending balance is: " + money.getBalance());
     oFile.println("The total amount of withdrawls are: " + w);
     oFile.println("The total amount of deposists are: " + d);
     oFile.println("The annual interest rate is: " + money.getInterest());
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My class file</p>
  
  <pre>
  /**
   * @(#)SavingsAccount.java
   *
   *
   * @author 
   * @version 1.00 2013/5/6
   */
  
  
  public class SavingsAccount {
  
          //variables
          private double interest;
          private double balance;
  
  
          //Constructor
          public SavingsAccount(double b)
          {
              balance = b;
              interest = 0.0;
          }
  
          //Accessors
          public void setInterest(double i)
          {
              interest = i;
          }
  
          public void setBalance(double b)
          {
              balance = b;
          }
  
          //Mutators
          public double getInterest()
          {
              return interest;
          }
  
          public double getBalance()
          {
              return balance;
          }
  
          //Withdraw method
          public void withdraw(double withdraw)
          {
              balance = balance - withdraw;
          }
  
          //Deposit method
          public void deposit(double deposit)
          {
              balance = balance + deposit;
          }
  
  
          //Adding monthly interest to the balance
          public void addInterest()
          {
              double x = ((interest/12) * balance);
              balance = balance + x;
          }
  
  }
  </pre>
  
  <p>I get these errors:</p>
  
  <pre>--------------------Configuration: --------------------
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:43: error: variable amountWithdraw might not have been initialized
              amountWithdraw += num;
              ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:46: error: variable w might not have been initialized
              w++;
              ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:50: error: variable amountWithdraw might not have been initialized
          money.withdraw(amountWithdraw);
                         ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:62: error: variable amountDeposit might not have been initialized
              amountDeposit += num;
              ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:65: error: variable d might not have been initialized
              d++;
              ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:69: error: variable amountDeposit might not have been initialized
          money.deposit(amountDeposit);
                        ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:73: error: variable filenameOutput might not have been initialized
         oFile=new PrintWriter (filenameOutput);
                                ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:75: error: variable w might not have been initialized
         oFile.println("The total amount of withdrawls are: " + w);
                                                                ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:76: error: variable d might not have been initialized
         oFile.println("The total amount of deposists are: " + d);
                                                               ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:37: error: unreported exception FileNotFoundException; must be caught or declared to be thrown
         iFile = new Scanner (wFile);
                 ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:55: error: unreported exception FileNotFoundException; must be caught or declared to be thrown
         iFile = new Scanner (dFile);
                 ^
  C:\Users\Home\Documents\JCreator Pro\MyProjects\SavingsAccount\src\SavingsAccountDemo.java:73: error: unreported exception FileNotFoundException; must be caught or declared to be thrown
         oFile=new PrintWriter (filenameOutput);
               ^
  12 errors
  
  Process completed.
  </pre>
  
  <p>I'm not looking for handouts, this is my first post for help here but I know you guys wont solve this for me...I just need to learn how to do this properly. I just have no idea why the initialization is having a problem (all mentioned variables are initialized) and the files are located in the same folder.</p>