Question: D . F 2 4 . 2 How much house can I afford ( 3 Points ) Write a Java program to determine how much
D F How much house can I afford Points
Write a Java program to determine how much you can afford to pay monthly for a house. The general rule is you should not exceed of your monthly income on your mortgage payment. Ask the user for their annual salary. Divide the annual salary by to get the monthly amount, then multiply by to estimate how much house they can buy mathpg We will use JOptionPane to interface with the user. Then, use JOptionPane pg to display the amount a person can afford at the salary entered. UNT
EX:
At the annual salary amount of:
You can afford a payment of:
HintsTips:
We will write this program in class but you'll learn more if you try to write this before class
Use for Java doesnt understand percentage specifically
You can use the escape sequence
pg in JOptionPane to go to a new line
Define all your variables before you use them
Use parse to convert the JOptionPane String to a double.
Do not format the numbers, well do that later. Sometimes it puts a lot of zeros with a at the end. Its related to the internal storage of numbers. In chapter well learn how to format numbers.
Rubric
Doesnt ask the user for the annual salary
Doesnt calculate the max monthly payment they can afford
Doesnt display the results
Code is not formatted correctly
Doesnt do System.exit for JOptionPane
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
