Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Determining how many vowels a user enters in the string

Posted on 2004-04-13
5
Medium Priority
?
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Make the most of your online learning experience.
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 …
Progress

715 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