﻿'Visual Basic 2012 Sorteren van Arrays - Insertion Sort Arrays Module ExerciseTask Sub Main() Dim count As Integer = 10 Dim currencies As String() = {"ATS", "DEM", "ESP", "FIM", "FRF", _ "IEP", "ITL", "LUF", "NLG", "PTE"} Dim conversionValues As Decimal() = {13.7603, 1.95583, 166.386, _ 5.94573, 6.55957, 0.787564, _ 1936.27, 40.3399, 2.20371, 200.482} ' Do Console.Write("Currencies : ") Dim index As Integer For index = 0 To count - 2 Console.Write(currencies(index) & " / ") Next Console.WriteLine(currencies(index)) Console.Write("Currency ? : ") Dim currency As String = Console.ReadLine() ' Dim found As Boolean ' ... binary search for currency in currencies ... ' If found Then ' ... conversion of certain amount ... Else Console.Write("Add Currency (Y/N) ? : ") Dim addCurrency As Char = Console.ReadLine() If addCurrency = "y"c OrElse addCurrency = "Y"c Then Console.Write("Conversion Value " & currency & _ " (= 1 EUR) ? : ") Dim conversionValue As Decimal = Console.ReadLine() ' ' ... insertion currency in currencies ... ' ... conversionValue in conversionValues ... End If End If Loop End Sub End Module 'Bezoek www.vbvoorbeelden.be voor meer Visual Basic voorbeelden. 'Copyright - De Wolf / vbvoorbeelden - 2003-2012 - Alle rechten voorbehouden.