Write a Java Class

0 comments

Write a Java Class/Program named MortgageValidation to determine if a candidate qualifies for a FHA Mortgage.

The qualifications given are:

  • Residence: The home must be your primary residence for at least the first year.
  • Down payment: They must have a credit score of at least 580.

The Java Program needs to do the following. This can all be done in the main() method.

  1. Create a boolean variable to store the Residence requirement.
  2. Prompt the user to “Enter 1 if the Home will be the primary residence, or 0 if not the primary residence”.
  3. Store the result of step 2 into a byte variable.
  4. Set the boolean variable from step 1 to true or false depending on value in step 3.
  5. Create an int variable to store the credit score.
  6. Prompt for the credit score and store it in the variable created in step 5.
  7. If the residency and credit score qualify, then display “Qualifies for the loan”. Otherwise display “Does not qualify for the loan”.

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.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}