import java.util.Scanner; public class LoanQualificationProgram3 { public static void main(String[] args) { 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"); // Get the applicant's information Applicant applicant = getUserInformation(); // Determine whether or not the person qualifies for the loan determineQualifications(applicant); System.out.println("Thank you, have a nice day ..."); } public static Applicant getUserInformation() { Applicant applicant = new Applicant(); // Get a Scanner object for user input Scanner keyboard = new Scanner(System.in); // Determine whether or not the user is employed System.out.print("Are you currently employed (Y/N)? "); char 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"); return applicant; } public static void determineQualifications(Applicant appl) { if (appl.employed) { if (appl.hasDegree) System.out.println("Congratulations! You qualify " + "for the ESL loan."); else { if (appl.age >= 30) { if (appl.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."); } }