rendered paste bodyimport javax.swing.*; // Needed for JOpionPanepublic class AcmeBankFINAL { public static void main(String[] args) { int numYrs = 0; int age; double loanAmount = 0.0; double anuInRate = 0.0; double loanTotal; double intRepay; double repayFactor; double totPayTime; double totalPayTime; double discount; double existAccDis = 0; double repaymentFactor = 0; boolean ozCitzen = true; boolean existAcc = false; String repaymentMethod = "monthly"; //Input LoanAmount, Annual Interest Rate, Number of Years, existing Account,Australian Citzen, Age loanAmount = Double.parseDouble(JOptionPane.showInputDialog("Requested Loan Amount")); anuInRate = Double.parseDouble(JOptionPane.showInputDialog("Annual Interest rate")); numYrs = Integer.parseInt(JOptionPane.showInputDialog("Number of years over which the loan will be paid in")); repaymentMethod = JOptionPane.showInputDialog("Replayment method, either 'quarterly', 'monthly' or 'fortnightly'"); existAcc = Boolean.valueOf(JOptionPane.showInputDialog("Do you have an existing account, 'true' or 'false'")); ozCitzen = Boolean.valueOf(JOptionPane.showInputDialog("Are you an Australian Citzen, 'true' or 'false'")); age = Integer.parseInt(JOptionPane.showInputDialog("How old are you? In Number format")); //Special Characteristics for existing Account, Australian Citzen and Their Age //Discount is the 0.5% of the Annual Interest Rate if(existAcc == true) { discount = 0.5; } else { discount = 0; //false they don't get the discount. } if(ozCitzen == false) { JOptionPane.showMessageDialog(null, "Citzen: you can not continue if your not Australian"); } else { if(age > 49) { JOptionPane.showMessageDialog(null, "Age: cannot specify a repayment period of greater than 10 years") ; } } //Loan Total Calc RETURN loanTotal = totLoanCalc(loanAmount, anuInRate, numYrs); intRepay = intRepay(loanAmount, loanTotal); existAccDis = existAccDis(anuInRate, discount, loanTotal); if (repaymentMethod.equals("monthly")) { repaymentFactor = 12; } else if (repaymentMethod.equals("quarterly")) { repaymentFactor = 4; } else if (repaymentMethod.equals("fortnightly")) { repaymentFactor = 26; } //The Total Repayment of Years and Repayment either Monthly, Quarterly, fortnightly totPayTime = totPayTime(numYrs, repaymentFactor); //Results JOptionPane.showMessageDialog(null, "Your Total Loan Repayment is" + " " + "$" +loanTotal); JOptionPane.showMessageDialog(null, "Your Total Loan Repayment is" + " " + "$" +intRepay); JOptionPane.showMessageDialog(null, "Your Total Repayment Period is" + " " +totPayTime); JOptionPane.showMessageDialog(null, "Loan Total with or without Discount" + " " + "$" +existAccDis); } public static double totLoanCalc(double loanAmount, double anuInRate, int numYrs){ return loanAmount * (1 + anuInRate / 100 * numYrs); } //Amount Of Interest Paid public static double intRepay(double loanAmount, double loanTotal){ return loanTotal - loanAmount; } //Repayment Period public static double totPayTime(int numYrs, double payFactor) { return numYrs * payFactor; } //Existing Account Discount public static double existAccDis(double anuInRate, double discount, double loanTotal) { return loanTotal - (1+ anuInRate / 100 * discount); }}