Ejemplo n.º 1
0
 public void Print()
 {
     Console.WriteLine("Principal: {0, 18:F}", loan.Principal);
     Console.WriteLine("Rate of interest: {0, 10:F}%", loan.Rate * 100);
     Console.WriteLine("Number of periods: {0, 10:D}\n", loan.Periods);
     Console.WriteLine("{0, 7}{1, 15}{2, 15}{3, 15}{4, 15}", "Periods", "Payment", "Repayment", "Interest", "Outstanding");
     for (int n = 1; n <= loan.Periods; ++n)
     {
         Console.WriteLine("{0, 7:D}{1, 15:F}{2, 15:F}{3, 15:F}{4, 15:F}", n, loan.Payment(n), loan.Repayment(n), loan.Interest(n), loan.Outstanding(n));
     }
 }