import java.util.Scanner; public class LoanQualificationProgram { public static void main(String[] args) { char charInput; boolean employed, hasDegree; int age, yearsWorked; // Get a Scanner object for user input Scanner keyboard = new Scanner(System.in); // 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); 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); hasDegree = (charInput == 'y') || (charInput == 'Y'); // Determine the user's age System.out.print("How old are you ? "); 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 ? "); yearsWorked = keyboard.nextInt(); System.out.println("\n"); // Now determine whether or not the person qualifies for the loan if (employed) { if (hasDegree) System.out.println("Congratulations! You qualify " + "for the ESL loan."); else { if (age >= 30) { if (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."); } } }