So basically all we know till now is basic programming. So while, and for loop, if and else functions, and int double and void functions, and a function with input and output parameters with a single return value or no return values. And the third one that you put a * before the variable so that the function could change the variable. So we used the C-free program to solve this question. So this is the question, and if anyone has a solution to all of it I could compare to mine I would be very grateful. This is not an ask for a homework , but it is me reviewing the questions on my book to train for the final. OKai this is the question.
Problem 1
#########
Write a program that generates a customized loan amortization table. Your
program will prompt the user to enter the amount borrowed (the principal),
the annual interest rate, and the number of payments (n). To calculate the
monthly payment, it will use the following formula:
payment = (i * P) / (1 - (1 + i)^(-n)), where
P = principal (the amount borrowed),
i = monthly interest rate (1/12 of the annual rate)
n = total number of payments.
This payment must be rounded up to the nearest cent. After the payment was
rounded, the program will write to the output file n lines showing how the
debt is paid off. Each month part of the payment is the monthly interest on
the principal balance, and the rest is applied to the principal. Because the
payment and each month's interest are rounded up to the nearest cent, the
final payment will be a bit different and must be calculated as the sum of
the final interest payment and the final interest payment and the final principal balance. Here is the outcome that should appear for a 1000$ loan borrowed at a 9% annual interest rate paid over six months
Principal $ 1000.00 Payment $171.07
Annual Interest 9.0% Term 6 months
Payment Number Toward Interest Toward Principal Principal
1 $ 7.50 $163.57 $ 836.43
2 $ 6.27 $164.80 $ 671.63
3 $ 5.04 $166.03 $ 505.60
4 $ 3.79 $167.28 $ 338.32
5 $ 2.54 $168.53 $ 169.79
6 $ 1.27 $169.79 $ 0.00
Final payment: $171.06