Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello, i am beginner programmer in java and im working on loops right now. but this one needs printf also. but i am still trying
Hello, i am beginner programmer in java and im working on loops right now. but this one needs printf also. but i am still trying to figure out how printf and loops are working properly. also i cant understand how to write math calculation part. need help for the whole program.
Write a complete Java program, including comments, to do the following: Your program will compute the monthly payment (monPayment - double) on a mortgage of amount principal (integer), with interest rate intRate (double) for numYears (integer) number of years The formula is written as follows: principal (intRate/12)* (1+(intRate/12))umYear *17 monPayment = ((1+(intRate/12))numyears 1Z )-1 For example if principal=$100,000, intRate = .07 and numYears = 30 years then the monthly payment is $665. Check that your code yields the same number before you go any further. power. To raise Use the pow function to raise a number to a power. Math.pow (10,5) means 10 to the 5 ?"b to the power of c*d use Math.pow(a*b, cfd) 1. The program should start by printing a header giving name(john), class(Java) and assignment number(number 2). Use a loop to print underscores report (see sample output below) as a horizontal line to add clarity to the 2. The program will compute the monthly payment of loans starting at $100,000 up to an including $1,000,000 in increments of $100,000) at 7 different interest rates (starting at .07 up to and including 1 in increments of .005) field size for intRate should match what you use for the monthly payment (in the section below) monthly payment containing 2 decimal places and up to 4 positions to the left of the decimal place 3. Use a printf statement for the column header, allowing 3 decimal places for the interest rate. The total 4. Use printf statements for: (a) the principal having no decimal places and max size of 7 positions and (b) Align all numbers to the right and align the monthly payments with the interest rate header above it. The final result should look as follows. Your numbers should exactly match those below TOUR NAME(john)> Principal 0.070 0.075 .080 0.085 0.100 200000 1330. 60 1398.13 1167.53 1537.83 1609.2 181.71 1755.11 800000 5322.1 5593. 71 5870.1 6151.31 6136.97 726.83 7020. 58 1000000 EE53.0 6992.11 733.5 76818046.22 8108.51 3775.72Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started