2016-03: Text 1
Write a program to count the number of vowels in a sentense.
Scrivi un programma per contare il numero di vocali in una frase.

'-------------------------------------------------------- INPUT
testo="ADDIO alle armi"
'-------------------------------------------------------- IMPOSTAZIONI
VOCALI="AEIOU"
For i=1 to 5
c=Text.GetSubText(VOCALI,i,1)
CONTA[c]=0
EndFor
'-------------------------------------------------------- CONTEGGI
For i=0 To Text.GetLength(testo)-1
c=Text.GetSubText(testo, i, 1)
c=Text.ConvertToUpperCase(c)
If (c = "A") Or (c = "E") Or (c = "I") Or (c = "O") Or (c = "U") Then
CONTA[c]=CONTA[c]+1
EndIf
EndFor
'-------------------------------------------------------- OUTPUT
TextWindow.WriteLine("Il testo '" + testo + "' contiene le vocali")
For i=1 to 5
c=Text.GetSubText(VOCALI,i,1)
TextWindow.WriteLine(" " + c + " = " + CONTA[c])
EndFor