Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Determining how many vowels a user enters in the string

Posted on 2004-04-13
5
Medium Priority
?
249 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:TysonFerro
5 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1000 total points
ID: 10820439
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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10820487
GrahamSkan, don't you think you are doing his homework ?
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10820583
what language?
if its VB, then grahamskan has done that 4 u
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 10820960
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
 

Author Comment

by:TysonFerro
ID: 10871721
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Six Sigma Control Plans
Starting up a Project

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question