Answer to Question #296409 in Visual Basic for Raymond

Question #296409

Develop a system that allows 20 characters and produce number of vowels

1
Expert's answer
2022-02-11T00:27:48-0500
Module Module1
    Sub Main()
        Dim nVowels As Integer
        Const allVowels As String = "aeiou"
        Console.Write("Enter the string: ")
        Dim InputString As String = Console.ReadLine()
        For i As Integer = 0 To InputString.Length - 1
            For j As Integer = 0 To allVowels.Length - 1
                If InputString.ToLower()(i) = allVowels(j) Then
                    nVowels = nVowels + 1
                End If
            Next
        Next
        Console.WriteLine("The total number of vowels are: " & nVowels)
        Console.ReadLine()
    End Sub


End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS