The monthly payment for a given loan pays the principal and the interest. The monthly interest is
Question:
The monthly payment for a given loan pays the principal and the interest. The monthly interest is computed by multiplying the monthly interest rate and the balance (the remaining principal). The principal paid for the month is therefore the monthly payment minus the monthly interest. Write a program that lets the user enter the loan amount, number of years, and interest rate and displays the amortization schedule for the loan. Here is a sample run:
Transcribed Image Text:
Loan Amount: 10000 JEnter Number of Years: 1 -Enter Annual Interest Rate: 7 PEnter Monthly Payment: 865.26 Total Payment: 10383.21 Payment# Interest Principal Balance 806.93 811.64 58.33 9193.07 8381.43 2 53.62 11 10.0 855.26 860.27 0.01 12 5.01 860.25 The balance after the last payment may not be zero. If so, the last payment should be the normal monthly payment plus the final balance. Hint. Write a loop to display the table. Since the monthly payment is the same for each month, it should be computed before the loop. The balance is initially the loan amount. For each iteration in the loop, compute the interest and principal, and update the balance. The loop may look like this: for (i = 1; i<= numberOfYears * 12; i++) { interest = monthlylnterestRate * balance; principal = monthlyPayment - interest; balance = balance - principal; System.out.printlin(i + "\t\t" + interest + "Itit" + principal + "\t\t" + balance):
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 57% (7 reviews)
Program plan Enter the loan amount number of years and interest rate from the user Cal...View the full answer
Answered By
Sidharth Jain
My name is Sidharth. I completed engineering from National Institute of Technology Durgapur which is one of the top college in India. I am currently working as an Maths Faculty in one of the biggest IITJEE institute in India. Due to my passion in teaching and Maths, I came to this field. I've been teaching for almost 3 years.
Apart from it I also worked as an Expert Answerer on Chegg.com. I have many clients from USA to whom I teach online and help them in their assignments. I worked on many online classes on mymathlab and webassign. I guarantee for grade 'A'.
4.90+
3+ Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Write a JSF page that lets the user enter loan amount, interest rate, and number of years, as shown in Figure 33.28a. Click the Compute Loan Payment button to compute and display the monthly and...
-
Write a program that prints the characters in the ASCII character table from ! to ~. Display ten characters per line. The ASCII table is shown in Appendix B. Characters are separated by exactly one...
-
Write a method with the following header to format the integer with the specified width. public static String format(int number, int width) The method returns a string for the number with one or more...
-
A strange function. Consider McCarthys 91 function: public static int mcCarthy(int n) { if (n > 100) return n - 10; return mcCarthy(mcCarthy(n+11)); } Determine the value of mcCarthy(50) without...
-
a) Prove that a strictly decreasing function from R to itself is one-to-one. b) Give an example of a decreasing function from R to itself that is not one-to-one.
-
The rate at which information can be transmitted on an electromagnetic wave is proportional to the frequency of the wave. Is this consistent with the fact that laser telephone transmission at visible...
-
True or False: Multiple roots can exist when using IRR and MIRR methods.
-
The manager of the Excom Service Station wants to forecast the demand for unleaded gasoline next month so that the proper number of gallons can be ordered from the distributor. The owner has...
-
The BiHye Cycle Company has three plants that supply deluxe bicycles to three main countries of USA, Canada, and Germany. The plants' daily capacities, the countries' yearly requirements, as well as...
-
A stone is thrown into the air at an angle above the horizontal and feels negligible air resistance. Which graph in Fig. Q3.16 best depicts the stones speed v as a function of time t while it is in...
-
A cancellation error occurs when you are manipulating a very large number with a very small number. The large number may cancel out the smaller number. For example, the result of 100000000.0 +...
-
Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an...
-
What should employees expect from their employers and their companies now in terms of rights and obligations, after Covid-19? Explain. Is loyalty to an employer a dead or dying concept now? Why or...
-
Students across the U.S. take the ACT test, which has scores that are normally distributed with a mean of 21 with a standard deviation of 5. If 250 students are randomly selected, what is the...
-
How are costs associated with the implementation of the Affordable Care Act impacting the private physicians? Is it cost prohibitive to be in private practice?
-
Discuss the importance of emerging economies in the global economy. Provide your discussion on the differences between the domestic business management (e.g., Pizza Hut in the U.S. market) and...
-
If Wiknam households expect higher inflation in the coming year, how might that effect Money Demand? How would that affect the real interest rate, the nominal interest rate and actual inflation?...
-
As a consultant with global sourcing skills, kindly suggest how BCL can leverage the opportunities to bring textiles/garments from Bangladesh to Canada using the following as a guide : Introduction...
-
Below are the auditor's calculations of several key ratios for Cragston Star Products Ltd. The primary purpose of this information is to assess the risk of financial failure, but any other relevant...
-
Use the T account for Cash below to record the portion of each of the following transactions, if any that affect cash. How do these transactions affect the companys liquidity? Jan. 2 Provided...
-
Which of the following has the lowest precedence? a. < b. == c. && d. ||
-
Which of the following statements correctly outputs the names of voters who live in district 6 and all voters who live in district 7? a. if(district == 6 || 7) System.out.println("Name is " + name);...
-
Which of the following displays Error when a student ID is less than 1000 or more than 9999? a. if(stuId < 1000) if(stuId > 9999) System.out.println("Error"); b. if(stuId < 1000 && stuId > 9999)...
-
Ralph makes ( 21)/(2) batches of oatmeal cookies. Each batch makes 24 cookies. Ralph gives away ( 1)/(4) of his cookies to his class at school and ( 2)/(5) of his remaining cookies to his bus driver....
-
Create a RESTful API using Node.js and Express that performs CRUD operations on a collection of books stored in memory.
-
Find a minimum spanning tree for the weighted graph using Kruskal's algorithm. B 18 C 23 A 16 S (5 22 20 19 24 23 E D
Study smarter with the SolutionInn App