import java.util.Scanner; public class LoanQualificationProgram2 { public static void main(String[] args) { char charInput; Applicant applicant; // Get a Scanner object for user input Scanner keyboard = new Scanner(System.in); // Make a new Employee object applicant = new Applicant(); // Display some opening instructions System.out.println("Bank of Java"); System.out.println("============"); System.out.println("Follow the instructions below to " + "determine whether or not you qualify " + "for a Entrepreneur Startup Loan...\n"); // Determine whether or not the user is employed System.out.print("Are you currently employed (Y/N)? "); charInput = keyboard.nextLine().charAt(0); applicant.employed = (charInput == 'y') || (charInput == 'Y'); // Determine if the user has a recent University degree System.out.print("Did you graduate with a University degree " + "in the past 6 months (Y/N)? "); charInput = keyboard.nextLine().charAt(0); applicant.hasDegree = (charInput == 'y') || (charInput == 'Y'); // Determine the user's age System.out.print("How old are you ? "); applicant.age = keyboard.nextInt(); // Determine the number of years worked at full time status System.out.print("How many years have you been working " + "at full time status ? "); applicant.yearsWorked = keyboard.nextInt(); System.out.println("\n"); // Now determine whether or not the person qualifies for the loan if (applicant.employed) { if (applicant.hasDegree) System.out.println("Congratulations! You qualify " + "for the ESL loan."); else { if (applicant.age >= 30) { if (applicant.yearsWorked >= 10) System.out.println("Congratulations! You qualify " + "for the ESL loan."); else System.out.println("Sorry, you must have worked " + "at least 10 years at full " + "time status to qualify."); } else System.out.println("Sorry, you must be a recent " + "University graduate or be at " + "least 30 years of age."); } } else { System.out.println("Sorry, you must be currently " + "employed to qualify."); } } }