Microsoft Small Basic

Program Listing: BWB179
TextWindow.WriteLine("Enter in some text,and i'll tell you how many vowels there are.")

txt = TextWindow.Read()

txt1 = Text.ConvertToLowerCase(txt)
For i = 1 To Text.GetLength(txt1)
TempText = Text.GetSubText(txt1,i,1)
If TempText = "a" Then
vowela = vowela + 1
ElseIf TempText = "e" Then
vowele = vowele + 1
ElseIf TempText = "i" Then
voweli = voweli + 1
ElseIf TempText = "o" Then
vowelo = vowelo + 1
ElseIf TempText = "u" Then
vowelu = vowelu + 1
EndIf
EndFor

TextWindow.WriteLine("how many times 'a' comes up: " + vowela)
TextWindow.WriteLine("how many times 'e' comes up: " + vowele)
TextWindow.WriteLine("how many times 'i' comes up: " + voweli)
TextWindow.WriteLine("how many times 'o' comes up: " + vowelo)
TextWindow.WriteLine("how many times 'u' comes up: " + vowelu)