 # Java Programming Assignment

Subject Computer Science Java Programming

## Question

Write a program that calculates a monthly mortgage payment; we will assume that the interest rate is compounded monthly.
You will need to do the following:
• Prompt the user for a double representing the annual interest rate.
• Prompt the user for the number of years the mortgage will be held (typical input here is 10, 15, or 30).
• Prompt the user for a number representing the mortgage amount borrowed from the bank.
• Calculate the monthly payment using the following formulas:
1. Monthly payment = ( mIR*M) / (1-(1/(1 + mIR)^(12*nOY) )) where
2. mIR = monthly interest rate = annual interest rate/ 12
3. nOY = number of years
4. M = mortage amount
• Output a summary of the mortgage problem, as follows:
1. The annual interest rate in percent notation
2. The mortgage amount in dollars
3. The monthly payment in dollars, with only two significant digits after the decimal point
4. The total payment over the years, with only two significant digits after the decimal point
5. The overpayment, i.e., the difference between the total payment over the years and the mortgage amount, with only two significant digits after the decimal point
6. The overpayment as a percentage ( in percent notation) of the mortgage amount

Formula: Monthly payment = ( mIR*M) / (1-(1/(1 + mIR)^(12*nOY) )) the last two brackets below the exponent ^(12*nOY)

## Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.text.DecimalFormat;
import java.util.Scanner;

public class Exercise73 {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
double intRate, amount, monthlyPayment, intRatePercent, totalPayment, overPayment, overPaymentPercent;
int yearsHeld;
System.out.print("Please enter in an interest rate in decimal form: ");...

This is only a preview of the solution. Please use the purchase button to see the entire solution

## Related Homework Solutions

Java & UML Programming Problems \$20.00
Java
UML
Programming
Coding
Computer Science
Fraction
Denominator
Numerator
Big Integers
Printing Outputs
Decimal Values
Arithmetic Operations
Java Programming Problems \$30.00
Java
Programming
Computer Science
Arrays
Fractions
Variables
Strings
Numerator
Denominator
Statements
Constructor
Object
Initialization
Binary Tree in Java \$40.00
Java
Programming
Coding
Computer Science
Binary Tree
Data
Generic Types
Functions
Variables
Recursive Methods
Nodes
Input
Output
Java Programming: Arrays Of Marks & Circles \$50.00
Java
Programming
Codes
Computer Science
Algorithms
Arrays
Marks
Circles
Geometry
Mathematics
Random Numbers
Boundaries
Statements
Loops
Variables
Points
Coordinates
Perimeters
Area
Java Program for Volleyball Scores \$20.00
Java
Programming
Computer Science
Volleyball
Scores
Points
Users
Loops
Arrays
Statements
Variables
Teams
Matches
Data Sets
Input
Output
Cylinder Containers in Java \$25.00
Java
Programming
Codes
Algorithms
Computer Science
Statements
Variables
Loops
Input
Output
Integers
Strings
Geometry
Mathematics
Cylinder