Need to add a loop until a sentinel value in entered. entering “Stop” for the name for the program end. how can i add a loop to create bank accounts

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question
100%
Need to add a loop until a sentinel value in entered. entering “Stop” for the name for the program end. how can i add a loop to create bank accounts
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Main.java X
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
A
O
A
E
e
{
return;
}
else
{
Random random-new Random();
double x=random.nextInt( bound: 15-5+1)+5;
r=Math.max (x, L/(i*12*10))/100;
}
System.out.println("No Account opened for "+fName+" "+lName+", requires minimum $100.00 Loan amount for Var
if(type.equals IgnoreCase( anotherString: "fixed"))
{
if (L<=1000)
r=0.0825;
else if(L>1000&&L<=5000)
r=0.0935;
else if (L>5000&&L<=10000)
r=0.1045;
else
r=0.1625;
I
}
double mPay=L*(r/n) *Math.pow(1+(r/n), i*n)/(Math.pow(1+(r/n), i*n)-1);
System.out.println("/n"+fName+" "+lName);
Random random=new Random();
int acno-random.nextInt( bound: 10000)+1;
System.out.println("Acct No: " +acno);
if(type.equalsIgnoreCase( anotherString: "fixed"))
System.out.println("Fixed Loan for "+i+" years at Interest Rate of "+String.format("%.2f", r*100)+"%");
if(type.equalsIgnoreCase( anotherString: "variable"))
{
}
System.out.println("Variable Loan for"+i+" years at Interest Rate of "+String.format("%.2f", r*100)+"%");
System.out.println("Loan Amount: $" +String.format("%.2f", L));
System.out.println("Monthly Payment: $"+String.format("%.2f", mPay));
!
Transcribed Image Text:29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 Main.java X 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 A O A E e { return; } else { Random random-new Random(); double x=random.nextInt( bound: 15-5+1)+5; r=Math.max (x, L/(i*12*10))/100; } System.out.println("No Account opened for "+fName+" "+lName+", requires minimum $100.00 Loan amount for Var if(type.equals IgnoreCase( anotherString: "fixed")) { if (L<=1000) r=0.0825; else if(L>1000&&L<=5000) r=0.0935; else if (L>5000&&L<=10000) r=0.1045; else r=0.1625; I } double mPay=L*(r/n) *Math.pow(1+(r/n), i*n)/(Math.pow(1+(r/n), i*n)-1); System.out.println("/n"+fName+" "+lName); Random random=new Random(); int acno-random.nextInt( bound: 10000)+1; System.out.println("Acct No: " +acno); if(type.equalsIgnoreCase( anotherString: "fixed")) System.out.println("Fixed Loan for "+i+" years at Interest Rate of "+String.format("%.2f", r*100)+"%"); if(type.equalsIgnoreCase( anotherString: "variable")) { } System.out.println("Variable Loan for"+i+" years at Interest Rate of "+String.format("%.2f", r*100)+"%"); System.out.println("Loan Amount: $" +String.format("%.2f", L)); System.out.println("Monthly Payment: $"+String.format("%.2f", mPay)); !
Main.java X
B
0
B
import java.io.*;
import java.util.*;
class bankLoanProcess
{
public static void main(String[] args) throws IOException
{
InputStreamReader ir=new InputStreamReader (System.in);
Buffered Reader br=new Buffered Reader (ir);
System.out.print("Enter your first name: ");
String fName=br.readLine().toUpperCase();
System.out.print("Enter your last name; ");
String LName=br.readLine().toUpperCase();
System.out.print("Enter type of account: ");
String type=br.readLine();
if(!type.equalsIgnoreCase( anotherString: "variable")&&!type.equalsIgnoreCase( another String: "fixed"))
System.out.println("Invalid Account Type entered...");
{
}
System.out.print("Enter loan amount: ");
double L=Double.parseDouble (br.readLine());
double n=12;
double r=0.0;
System.out.print("Enter time of loan in years: ");
int i=Integer.parseInt(br.readLine());
if(type.equals IgnoreCase( anotherString: "variable"))
if (L<100)
{
bankLoanProcess
return;
System.out.println("No Account opened for "+fName+" "+lName+", requires minimum $100.00 loan amount for Va
Account
Transcribed Image Text:Main.java X B 0 B import java.io.*; import java.util.*; class bankLoanProcess { public static void main(String[] args) throws IOException { InputStreamReader ir=new InputStreamReader (System.in); Buffered Reader br=new Buffered Reader (ir); System.out.print("Enter your first name: "); String fName=br.readLine().toUpperCase(); System.out.print("Enter your last name; "); String LName=br.readLine().toUpperCase(); System.out.print("Enter type of account: "); String type=br.readLine(); if(!type.equalsIgnoreCase( anotherString: "variable")&&!type.equalsIgnoreCase( another String: "fixed")) System.out.println("Invalid Account Type entered..."); { } System.out.print("Enter loan amount: "); double L=Double.parseDouble (br.readLine()); double n=12; double r=0.0; System.out.print("Enter time of loan in years: "); int i=Integer.parseInt(br.readLine()); if(type.equals IgnoreCase( anotherString: "variable")) if (L<100) { bankLoanProcess return; System.out.println("No Account opened for "+fName+" "+lName+", requires minimum $100.00 loan amount for Va Account
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Basics of loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT