In: Computer Science
Acquire the first name of the applicant. Use the applicant’s name in the required prompts to show that you are a friendly bank.
Prompt the customer to enter the percentage of his/her down payment which is a double value. Note if the percentage is 23.4%, the customer will enter “23.4” without the percentage sign.
If the customer can NOT put at least 15% down, reject the application.
If the customer can put 15% or more as the down payment, prompt the customer to enter his/her credit score which is supposed to be an integer.
If the customer’s credit score is less than 500, reject the application.
If the customer’s credit score is greater than or equal to 500, approve the application.
At the very beginning of the file, write the following lines as comments.
// By Joe Smith (replace it by your name)
// Homework 2, xx/xx/xxxx (replace it by the submission date)
// Home Loan Approval Engine
If the customer’s credit score is less than 500, reject the application.
If the customer’s credit score is greater than or equal to 500, approve the application.
At the very beginning of the file, write the following lines as comments.
// By Joe Smith (replace it by your name)
// Homework 2, xx/xx/xxxx (replace it by the submission date)
// Home Loan Approval Engine
Name your file HomeLoanApproval.java
// By Joe Smith (replace it by your name)
// Homework 2, xx/xx/xxxx (replace it by the submission date)
// Home Loan Approval Engine
import java.util.Scanner;
class HomeApproval
{
public static void main (String[] args)
{
Scanner input = new
Scanner(System.in);
System.out.println("Enter the first
name of the applicant : ");
String firstName =
input.nextLine();
System.out.println(firstName+"
enter the percentage of your down payment : ");
double downPaymentPercentage =
input.nextDouble();
if(downPaymentPercentage <
15.0)
System.out.println("Sorry
"+firstName+" your application is rejected");
else
{
System.out.println(firstName+" , enter your credit score :
");
int creditScore
= input.nextInt();
if(creditScore
< 500)
System.out.println("Sorry "+firstName+" your application is
rejected");
else
System.out.println("Congratulations!! "+firstName+" your
application has been approved");
}
}
}
Output:
Enter the first name of the applicant : Adams Adams enter the percentage of your down payment : 15.1 Adams , enter your credit score : 520 Congratulations!! Adams your application has been approved