Simple JavaScript Mortgage Calculator

Write a program to calculate monthly mortgage payments.

• You can try an example.

• And another.

• And yet another.

The program takes three GET inputs:

• Principal, e.g., 100000. Required, numeric, more than zero, less than one billion.

• Annual interest rate, e.g., 3.92. Required, numeric, more than zero, less than 20.

• Term in years, e.g., 30. Required, numeric, more than zero, less than 50.

Be sure to:

• Validate all values.

• Use validation functions.

• Put the functions in a code library.

• Show appropriate error messages.

• Show all error messages that apply.

• Round payments to two decimal places.

• Put your name in the footer.

Show output as in the samples. You do not need to match the style exactly.

If the payments are less than $2,000, show the message "You should get two doggos." Otherwise, show "You should get a doggo."

 

Need a custom answer at your budget?

This assignment has been answered 2 times in private sessions.

© 2024 Codify Tutor. All rights reserved