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