Java Demonstrate that you know how to define variables in a program, create conditional statements, write a
Question:
Java
- Demonstrate that you know how to define variables in a program, create conditional statements, write a loop, obtain input from the user, validate input, and display output.
Create a Loan Amortization Schedule based on user input. Allow the user to enter a loan amount, number of years for the loan, and the annual interest rate. (10 points) You must use the ReadIntegerFromUser and ReadFloatFromUser methods for user input (provided earlier in this course - 25 points). Be sure to validate the user input. (10 points) Refer to the steps for tips on how to create this program. Be sure to follow proper naming conventions taught in this class. (20 points) You must use printf in this program. (10 points) Be sure to submit your .java program and a print-screen of your test results (25 points).
// Calculate monthly interest rate by dividing the annual interest rate by 1200
// Calculate monthly payment = loan amount * monthly rate /
( 1 - 1 / Math.pow(1 + monthlyRate, years * 12));
doublemonthlyPayment =loanAmount *monthlyRate /
(1 - 1 / Math.pow(1 +monthlyRate,years * 12));
// Calculate total payment asthis: (monthly payment * 12) * NumberOfYears
// Display monthly payment
// Display total payment
// Create amortization schedule with the Payment#, Interest, Principal, and Balance
The output must be in this layout with the blank line. Be sure the payment #, interest, principal, and balance print on one line. (20 points)
Your Name - Loan Amortization Schedule
Class - IT-161-###
Enter Loan Amount:
10000
Enter Number of Years:
1
Enter Annual Interest Rate:
3.25
Monthly Payment: 848.08
Total Payment: 10176.91
Payment# Interest Principal Balance
1 27.08 820.99 9179.01
2 24.86 823.22 8355.79
3 22.63 825.45 7530.34
4 20.39 827.68 6702.66
5 18.15 829.92 5872.74
6 15.91 832.17 5040.57
7 13.65 834.42 4206.14
8 11.39 836.68 3369.46
9 9.13 838.95 2530.51
10 6.85 841.22 1689.29
11 4.58 843.50 845.79
12 2.29 845.79 -0.00
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates