//Visual Basic 2010 Nut van OOP Object Oriented Programming public class Client3 { int count; int capacity = 16; decimal[] loans = new decimal[0]; void Main() { this.AddLoan(1000, 5, 24); this.AddLoan(5000, 10, 10); this.AddLoan(10000, 2, 24); this.RemoveLoan(1); decimal amount = this.loans(0, index); decimal intrestRate = this.loans(1, index); int monthDuration = this.loans(2, index); Console.WriteLine(((this.GetTotalPayment(amount, intrestRate) + " ") + this.GetMonthlyPayment(amount, intrestRate, monthDuration))); Console.ReadLine(); } void AddLoan(decimal amount, decimal intrestRate, int monthDuration) { if ((this.count == this.capacity)) { this.capacity = 2; } this.loans(0, this.count) = amount; this.loans(1, this.count) = intrestRate; this.loans(2, this.count) = monthDuration; this.count += new System.EventHandler(1); } void RemoveLoan(int index) { int shiftIndex; this.loans(0, shiftIndex) = this.loans(0, (shiftIndex + 1)); this.loans(1, shiftIndex) = this.loans(1, (shiftIndex + 1)); this.loans(2, shiftIndex) = this.loans(2, (shiftIndex + 1)); this.loans(0, shiftIndex) = 0; this.loans(1, shiftIndex) = 0; this.loans(2, shiftIndex) = 0; this.count = 1; } void GetTotalPayment(decimal amount, decimal intrestRate) { GetTotalPayment = (amount * (1 + (intrestRate / 100))); } void GetMonthlyPayment(decimal amount, decimal intrestRate, int monthDuration) { GetMonthlyPayment = (this.GetTotalPayment(amount, intrestRate) / monthDuration); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.