In C++ Use a validation loop to prompt for and get from the user the car loan amount in the range $1,000-5,000. Then use a validation loop to prompt for and get from the user the monthly payment in...

In C++ Use a validation loop to prompt for and get from the user the car loan amount in the range $1,000-5,000. Then use a validation loop to prompt for and get from the user the monthly payment in the range $100-500. Then use a validation loop to prompt for and get from the user the annual interest rate in the range 2-5%. Convert the valid rate to a monthly rate and to a decimal number with formula: rate / 12 / 100 Loop to show the loan being repaid and keep track of the number of months it takes to do so. Before the loop, initialize the balance to the loan amount and months to zero. Within the loop, calculate the interest portion of each monthly payment, the principal portion of the payment, and the new balance with formulas: interest = balance * rate; principal = payment - interest; balance = balance - principal; Continue to loop while the balance is greater than zero. After the loop, print the number of months it took to repay the loan. Format the output in columns and show all real numbers to two decimal places.

May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here