Question: D . F 2 4 . 2 How much house can I afford ( 3 Points ) Write a Java program to determine how much

D. F24.2 How much house can I afford (3 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 28% of your monthly income on your mortgage payment. Ask the user for their annual salary. Divide the annual salary by 12 to get the monthly amount, then multiply by .28(28%) to estimate how much house they can buy (math-pg55). We will use JOptionPane to interface with the user. Then, use JOptionPane (pg 93-98) to display the amount a person can afford at the salary entered. ( UNT-'24)
EX:
At the annual salary amount of: 90000.0
You can afford a payment of: 2100.0
Hints/Tips:
We will write this program in class (but you'll learn more if you try to write this before class)
Use .28 for 28%(Java doesnt understand percentage specifically).
You can use the escape sequence
(pg 36-37) 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 1 at the end. Its related to the internal storage of numbers. In chapter 3 well learn how to format numbers.
Rubric
Doesnt ask the user for the annual salary (-1.3)
Doesnt calculate the max monthly payment they can afford (-1.3)
Doesnt display the results (-.4)
Code is not formatted correctly (-.1)
Doesnt do System.exit(0) for JOptionPane (-.02)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!