Solved

Determining how many vowels a user enters in the string

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is an explanation of a simple data model to help parse a JSON feed
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

929 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

14 Experts available now in Live!

Get 1:1 Help Now