This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Practical Session 9 Solutions Exercises 1. My code is as follows. / * loan.c * Simple code for loan amortisation. * / #include <stdio.h> #define I (0.12/26.0) / * interest rate * / #define A 500000.0 / * amount of loan * / #define S 2000.0 / * amount of each repayment * / int main() { int k; float pk, time=0.0, total=0.0; pk = A; for (k = 1; (time < 100.0) && (pk > 0); k++) { pk = (1.0 + I) * pk  S; total += S; time = k/26.0; printf("%.2f %.2f %.2f\n", time, pk, total); } return 0; } (a) The loan is repaid after 17.08 years. The total amount paid is $888,000. (At that point the borrower has overpaid by $1270.54, so the bank should refund this and then the total paid is about $886,729.50) (b) Figure 1 shows the result. The loan is repaid more rapidly as the amount owing becomes smaller. (c) In this case the amount owing grows with time, as the payments are not meeting the interest. If the loan is to be repaid ( P k +1 < P k ) then for each repayment the amount paid must exceed the interest for the given interval, i.e. we require S > iP k . The largest value of P k is P = A , so we require S > iA . For the given values the requirement is S > $2307 . 69 , which is not met. Fixing S = $2000 , the maximum interest rate the...
View Full
Document
 Three '09
 wheatland

Click to edit the document details