Question

In: Computer Science

Write a Java Program to determine if a candidate qualifies for a FHA Mortgage. (using eclipse...

Write a Java Program to determine if a candidate qualifies for a FHA Mortgage. (using eclipse IDE)

The qualifications given are:
  • Residence: The home must be your primary residence.
  • Down payment: They must have a credit score of at least 563.
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". Store the result of step 2 into a byte variable.
  3. Set the boolean variable from step 1 to true or false depending on value in step 2.
  4. Create an int variable to store the credit score.
  5. Prompt for the credit score and store it in the variable created in step 5.
  6. 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.

Solutions

Expert Solution

hey there ! i am done with the code ,,, Please give me a like to appciate my work and efforts....

here is the code -

package FHA;

import java.util.Scanner;

/**
*
* @author Aditya kumar
*/
public class FHAClass {

public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
//step 1 : declaring boolean variable
boolean primaryresidence=false;
  
int creditscore=0;
System.out.println("Enter 1 if the Home will be the primary residence, or 0 if not the primary : ");
int check=sc.nextInt();
  
  
//step 2 for the credit score
  
System.out.println("Enter the Credit Score : ");
creditscore=sc.nextInt();
  
if(creditscore>=563 && check==1)
{
System.out.println("Qualifies for the Loan .");
primaryresidence=true;

}
else if(creditscore<563 && check==0)
{
System.out.println("Does not Qualify for the Loan .");
primaryresidence=false;

}
  
else
{
System.out.println("Please Enter appropiate option ");
}
  
  
  
  
  
}
}

and the snapshot of the output is -

Thank You ! Dont forget to like !


Related Solutions

Using Java preferably with Eclipse Task: Write a program that creates a class Apple and a...
Using Java preferably with Eclipse Task: Write a program that creates a class Apple and a tester to make sure the Apple class is crisp and delicious. Instructions: First create a class called Apple The class Apple DOES NOT HAVE a main method Some of the attributes of Apple are Type: A string that describes the apple.  It may only be of the following types:  Red Delicious  Golden Delicious  Gala  Granny Smith Weight: A decimal value representing...
Using ECLIPSE IDE Write a Java Program to play your version of the Texas Pick 3...
Using ECLIPSE IDE Write a Java Program to play your version of the Texas Pick 3 Lottery. You will need to include the provided code given below in your program. Task:The program will prompt for a number between 0 and 999. Your program will display the number of attempts it took for the entered number to match a randomly generated number. In the main() method, declare an int named myPick3choice. Create a prompt for myPick3choice as "Enter your Pick 3...
write on eclipse java Write a program named lab5 that will play a game of Blackjack...
write on eclipse java Write a program named lab5 that will play a game of Blackjack between the user and the computer. Create a second class named Card with the following: Define the following private instance variables: cardValue (int) & cardSuite (String) Write a constructor with no parameters that will Set cardValue to a random number between 1 and 13 Generate a second random number between 0 and 3 and assign cardSuite a string based on its value (0 –...
I need to write a java program (in eclipse) that will read my text file and...
I need to write a java program (in eclipse) that will read my text file and replace specific placeholders with information provided in a second text file. For this assignment I am given a text file and I must replace <N>, <A>, <G>, with the information in the second file. For example the information can be John 22 male, and the template will then be modified and saved into a new file or files (because there will be multiple entries...
Create a Java Program to calculate luggage costs. USING ECLIPSE IDE The Business Rules are: A....
Create a Java Program to calculate luggage costs. USING ECLIPSE IDE The Business Rules are: A. Two bags per person are free. B. The Excess Bag Charge is $75 per bag. The program needs to do the following: 1. In your main method(),    Create integers to store the number of Passengers and also the total number of bags    Prompt for the number of passengers on a ticket.    Prompt for the total number of bags for all passengers...
Create a Java Program to show a savings account balance. using eclipse IDE This can be...
Create a Java Program to show a savings account balance. using eclipse IDE This can be done in the main() method. Create an int variable named currentBalance and assign it the value of 0. Create an int variable named amountToSaveEachMonth. Prompt "Enter amount to save each month:" and assign the result to the int variable in step 2. Create an int variable name numberOfMonthsToSave. Prompt "Enter the number of months to save:" and store the input value into the variable...
Using Eclipse IDE Create a Java Program/Class named MonthNames that will display the Month names using...
Using Eclipse IDE Create a Java Program/Class named MonthNames that will display the Month names using an array. 1. Create an array of string named MONTHS and assign it the values "January" through "December". All 12 months need to be in the array with the first element being "January", then "February", etc. 2. Using a loop, prompt me to enter an int variable of 1-12 to display the Month of the Year. Once you have the value, the program needs...
Write a program in Java Using object Orientation Design to determine the status of Mini Van...
Write a program in Java Using object Orientation Design to determine the status of Mini Van Doors. A logical circuit receives a different binary code to allow opening different doors. The doors can be opened by a dashboard switch, inside or outside handle. The inside handle will not open the door if the child safety lock is on or the master lock is on. The gear shift must be in the park to open the door. A method must be...
Write a program in Java Using object Orientation Design to determine the status of Mini Van...
Write a program in Java Using object Orientation Design to determine the status of Mini Van Sliding Doors. A logical circuit receives a different binary code to allow opening different doors. The doors can be opened by a dashboard switch, inside or outside handle. The inside handle will not open the door if the child safety lock is on or the master lock is on. The gear shift must be in the park to open the door. A method must...
Write a program in Java Using object Orientation Design to determine the status of Mini Van...
Write a program in Java Using object Orientation Design to determine the status of Mini Van Sliding Doors. A logical circuit receives a different binary code to allow opening different doors. The doors can be opened by a dashboard switch, inside or outside handle. The inside handle will not open the door if the child safety lock is on or the master lock is on. The gear shift must be in the park to open the door. A method must...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT