In: Computer Science
Write a Java Program to determine if a candidate qualifies for a FHA Mortgage.
The qualifications given are:
The Java Program needs to do the following. This can all be done in the main() method.
This can all be done inside the main() method.
Example Input/Output:
Enter 1 if the Home will be the primary residence, or 0 if not the primary residence: 1
Enter the Credit Score: 500
Does not qualify for the loan.
Code
import java.util.Scanner;
public class FHAMortgage {
public static void main(String[] args) {
Scanner scnr=new Scanner(System.in);
byte primaryResidence;
int crediteScore;
boolean requirement=true;
System.out.print("Enter 1 if the Home will be the primary
residence, or 0 if not the primary residence: ");
primaryResidence=scnr.nextByte();
if(primaryResidence==0)
requirement=false;
System.out.print("Enter the Credit Score: ");
crediteScore=scnr.nextInt();
if(crediteScore<563)
requirement=false;
if(requirement)
System.out.println("Qualifies for the loan");
else
System.out.println("Does not qualify for the loan.");
}
}
outputs
If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.