%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
Error: Salary, Loan Amount, and Credit Score must be greater than zero.
"); valid = false; } if (valid) { double maxLoanCap = 0.0; String interestRate = "N/A"; boolean eligible = true; // Salary-based cap if (salary > 80000) { maxLoanCap = 100000; } else if (salary >= 50000) { maxLoanCap = 50000; } else if (salary >= 30000) { maxLoanCap = 20000; } else { eligible = false; out.println("Loan Denied: Salary too low for eligibility.
"); } // Credit score requirement if (creditScore < 600) { eligible = false; out.println("Loan Denied: Credit score too low.
"); } else if (creditScore <= 700) { interestRate = "8%"; } else if (creditScore <= 800) { interestRate = "5%"; } else { interestRate = "3%"; } if (eligible) { if (loanAmount > maxLoanCap) { out.println("Loan Denied: Requested amount exceeds maximum allowed ($" + maxLoanCap + ").
"); } else { out.println("Name: " + name + "
"); out.println("Salary: $" + salary + "
"); out.println("Requested Loan: $" + loanAmount + "
"); out.println("Credit Score: " + creditScore + "
"); out.println("Approved Amount: $" + loanAmount + "
"); out.println("Interest Rate: " + interestRate + "
"); } } } } %>