Summary When you borrow money to buy a house, a car, or for some other purposes, then you typically repay it by making periodic payments. Suppose that the loan amount is L, r is the interest rate per year, m is the number of payments in a year, and the loan is for t years. Suppose that i = (r / m) and r is in decimal. Then the periodic payment is (first image which R=....):     You can also calculate the unpaid loan balance after making certain payments. For example, the unpaid balance after making k payments is (second image which L'=....) :     where R is the periodic payment. (Note that if the payments are monthly, then m = 12.) Instructions Write a program that prompts the user to input the values of L, r, m, t, and k. The program then outputs the appropriate values. Your program must contain at least two functions, with appropriate parameters, to calculate the periodic payments and the unpaid balance after certain payments. Make the program menu driven and use a loop so that the user can repeat the program for different values. Example of expected output: Enter (Y/y) to find the periodic payment and unpaid balance after certain payments: y Enter the loan amount: 20000 Enter the interest rate per year as a percentage: 2.75 Enter the number of payments per year: 12 Enter the number of years for the loan: 30 The periodic payment is: 81.65 Enter the number of payments made: 20 The unpaid balance after 20 payment(s) is : 19267.89 Enter (Y/y) to find the periodic payment and unpaid balance after certain payments: n

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

Summary

When you borrow money to buy a house, a car, or for some other purposes, then you typically repay it by making periodic payments. Suppose that the loan amount is L, r is the interest rate per year, m is the number of payments in a year, and the loan is for t years. Suppose that i = (r / m) and r is in decimal. Then the periodic payment is (first image which R=....):

 

 

You can also calculate the unpaid loan balance after making certain payments. For example, the unpaid balance after making k payments is (second image which L'=....) :

 

 

where R is the periodic payment. (Note that if the payments are monthly, then m = 12.)

Instructions

Write a program that prompts the user to input the values of L, r, m, t, and k. The program then outputs the appropriate values. Your program must contain at least two functions, with appropriate parameters, to calculate the periodic payments and the unpaid balance after certain payments. Make the program menu driven and use a loop so that the user can repeat the program for different values.

Example of expected output:

Enter (Y/y) to find the periodic payment and unpaid balance after certain payments: y Enter the loan amount: 20000 Enter the interest rate per year as a percentage: 2.75 Enter the number of payments per year: 12 Enter the number of years for the loan: 30 The periodic payment is: 81.65 Enter the number of payments made: 20 The unpaid balance after 20 payment(s) is : 19267.89 Enter (Y/y) to find the periodic payment and unpaid balance after certain payments: n

Format your output with setprecision(2) to ensure the proper number of decimals for testing!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning