import java.util.Scanner; 
/**
   This program demonstrates a nested if statement.

	@author Gaddis, modified by N. Harris
	@version 09/22/09
**/

public class LoanQualifierLO
{
	/**
	 entry point to the application
	 
	 @param args unused in this application
	 */
   public static void main(String[] args)
   {
      double 	salary;       // Annual salary
      double 	yearsOnJob;   // Years at current job
		Scanner 	keyboard;	  // keyboard for input

		keyboard = new Scanner(System.in);
      System.out.print("Enter your annual salary: ");
      salary = keyboard.nextDouble();

      // Get the number of years at the current job.
      System.out.print("\nEnter the number of " +
       "years at your current job: ");
      yearsOnJob = keyboard.nextDouble();
		System.out.print("\n");

      // Determine whether the user qualifies for the loan.
      if (salary >= 30000 && yearsOnJob >= 2)
      {
         System.out.println("You qualify for the loan.");
      }
      else
      {
			if (yearsOnJob < 2)
			{
			   System.out.println("You must have " +
             "been on your current job for at least " + 
             "two years to qualify.");
         }
			else
      	{
            System.out.println("You must earn " +
             "at least $30,000 per year to qualify.");
      	}
		}
   }
}
