Question
here is my code from last week import java.util.Scanner; import java.text.DecimalFormat; public class bankLoanProcess { public static void main (String[] args) { double L, MonthlyPayment,
here is my code from last week
import java.util.Scanner; import java.text.DecimalFormat;
public class bankLoanProcess {
public static void main (String[] args) { double L, MonthlyPayment, TotalAmountOfLoan, TotalInterest, InterestRate, rand; int i, n, acctNo; String firstName, lastName, loanType; DecimalFormat df = new DecimalFormat("##.##%"); Scanner input = new Scanner(System.in); System.out.println("Enter customer's first name: "); firstName = input.nextLine(); System.out.println("Enter customer's last name: "); lastName = input.nextLine(); System.out.println("Enter loan type: "); loanType = input.nextLine(); System.out.println("Enter Loan Amount: "); L = input.nextDouble(); System.out.println("Enter Length of Loan in years: "); i = input.nextInt(); n = 12; acctNo = (int) (Math.random()*1000+1); if(loanType.equalsIgnoreCase("Variable")) { /ew logic if(L>=100) { rand = (Math.random()*10+5); InterestRate=(Math.max(rand, (L/(i*12*10))))/100; MonthlyPayment=L * ((InterestRate) * Math.pow(( 1 + InterestRate), i * n))/((Math.pow(( 1 + InterestRate), i *n))-1); System.out.println(firstName + " " + lastName); System.out.println("Acct No: " + acctNo); System.out.println(loanType + " loan for " + i + " years at an interest rate of " + df.format(InterestRate)); System.out.printf("Loan Amount: $%.2f " , L); System.out.printf("Monthly Payments wull be: $%.2f " , MonthlyPayment); } else { System.out.println("No account opened for " + firstName + " " + lastName + ", requires minimum $100.00 loan amount for variable loan."); } } else { if (L
}
-OOPS _et's learn to repeat a set of instructions, or block \{\} of code, by using the a Loop structure in Java. 13 points] Submit bankLoanLoop.java the sentinel value for name, if we enter "STOP" for the name the program ends, otherwise we continue to create customer bank accountsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started