Question: Create a Project called LoanDecision with a class called LoanDecision. Write a Java program to approve or reject a loan based on the borrowers credit

Create a Project called LoanDecision with a class called LoanDecision.

Write a Java program to approve or reject a loan based on the borrowers credit score. Ask for the following values (use double variables).

Credit Score (must be between 300 and 850).

Loan Amount (must be between 500 and 20000).

You should start by copying your code from CreditScore and modify it as follows.

Define an enum (CreditRiskEnum) for the credit risk (EXCELLENT, VERYGOOD, GOOD, FAIR, POOR, INVALID). Put it inside your class, above the main method.

Assign the correct enum value to a variable creditRisk with multi-way branching (if else if).

Use a switch statement on the creditRisk variable, then use an if statement in each case to approve the loan if it is less than or equal to the credit limit.

creditRisk

creditLimit ($)

INVALID

0

POOR

500

FAIR

1000

GOOD

2,000

VERYGOOD

5,000

EXCELLENT

1,0000

If either of the input values is out of range, output an error message.

CreditScore2 by Ray Henry

Enter the Credit Score: 644

Enter the Loan Amount: 1001 The loan application is denied

CreditScore2 by Ray Henry

Enter the Credit Score: 644

Enter the Loan Amount: 1000 The loan application is approved

CreditScore2 by Ray Henry

Enter the Credit Score: 0

The credit score is invalid.

Enter the Loan Amount: 400

The loan amount is invalid.

The loan application is denied

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!