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

Write a Java Program to determine if a candidate qualifies for a FHA Mortgage. The qualifications...
Write a Java Program to determine if a candidate qualifies for a FHA Mortgage. 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. Create a boolean variable to store the Residence requirement. Prompt the user to "Enter 1 if the Home will be the primary residence, or 0...
Program: Java (using eclipse) Write a program that asks the user to enter today’s sales for...
Program: Java (using eclipse) Write a program that asks the user to enter today’s sales for five stores. The program should then display a bar chart comparing each store’s sales. Create each bar in the bar chart by displaying a row or asterisks. Each asterisk should represent $100 of sales. You must use a loop to print the bar chart!!!! If the user enters a negative value for the sales amount, the program will keep asking the user to enter...
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 –...
Write a Java program in Eclipse to calculate the total cost to enter into a waterpark...
Write a Java program in Eclipse to calculate the total cost to enter into a waterpark for a family/group Ticket rates are listed below kids (Age 12 and under)=$ 12.50 Regular( Age between12 -55) =$ 18.25 Seniors (55 and above) = $15.00 Tax =7% Your program should ask the user to enter the total number of members in their group. User needs to enter the ages for all members. Write appropriate error messages for invalid entries. An array should be...
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...
for eclipse java Overview Write a program that translates an English phrase into a Pig Latin...
for eclipse java Overview Write a program that translates an English phrase into a Pig Latin phrase. Input a phrase from the user and translate it to pig latin. You can assume the phrase will be on a single line. Use at least the REQUIRED METHODS listed below, with the exact same SPELLING for method names and parameters. Input Specification The input will be an English phrase, with NO terminal punctuation. Read the phrase as a SINGLE STRING using the...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT