Solved

Determining how many vowels a user enters in the string

Posted on 2004-04-13
5
226 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 250 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
for loop with Set 4 45
bunnyEars challenge 6 62
sumDigits  challenge 7 60
When i run adoquery my application freezes 26 92
A short article about problems I had with the new location API and permissions in Marshmallow
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.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now