Determining how many vowels a user enters in the string

I need a little help in getting a program going.  I need an application that reads a string from the user then determines and prints how many of each lowercase vowels appear in the entire string.  Thank you.
TysonFerroAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
GrahamSkanConnect With a Mentor RetiredCommented:
This will do it in VB

Private Sub Command1_Click()
Dim strVowels As String
Dim i As Integer
Dim j As Integer
strVowels = InputBox("Please type in your text", "Vowel Counter")
For i = 1 To Len(strVowels)
    Select Case Mid$(strVowels, i, 1)
        Case "a", "e", "i", "o", "u"
            j = j + 1
    End Select
Next i
MsgBox "There " & IIf(j = 1, "is", "are") & " " & j & " vowel" & IIf(j = 1, "", "s") & " in the text:" & vbCrLf & "" & strVowels & ""
End Sub
0
 
sunnycoderCommented:
GrahamSkan, don't you think you are doing his homework ?
0
 
rockiroadsCommented:
what language?
if its VB, then grahamskan has done that 4 u
0
 
GrahamSkanRetiredCommented:
sunnycoder,
You could be right. I did think it was a strange requirement, but homework didn't occur to me.

TysonFerro,
If that is the case, I hope you will take the time to examine the code and learn from it.
0
 
TysonFerroAuthor Commented:
I wish it was homework.  Actually it is the beginning of a program that helps little kids read and distinguish vowels, but anyway the posts were very helpful.  Thank You.
0
All Courses

From novice to tech pro — start learning today.