Microsoft Small Basic

Program Listing: FJQ534
'-----------------------------------------Variables-------------------------------------------
vowelsOnly = "aeiou"
For i = 1 To Text.GetLength(vowelsOnly)
vowels[i] = Text.GetSubText(vowelsOnly, i, 1)
countVowel[i] = 0
EndFor
'------------------------------------------Main Program------------------------------------
AskForString()
inputString = Text.ConvertToLowerCase(TextWindow.Read())

For i = 1 To Text.GetLength(inputString)
characters[i] = Text.GetSubText(inputString, i, 1)
For j = 1 To Array.GetItemCount(vowels)
If vowels[j] = characters[i] Then
countVowel[j] = countVowel[j] + 1
EndIf
EndFor
EndFor

For i = 1 To Array.GetItemCount(vowels)
TextWindow.Write("the vowel " + vowels[i] + " is used ")
TextWindow.WriteLine(countVowel[i] + " times")
EndFor
'-----------------------------------------------Subroutines---------------------------------------
Sub AskForString
TextWindow.Write("Enter a string of text and the program will")
TextWindow.Write(" pass the output of how many times a vowel")
TextWindow.WriteLine(" is used to the screen.")
EndSub