What's new

Closed Create a program that shows the consonant and vowels in the words given inside the listbox

Status
Not open for further replies.

Made-In-Heaven

Honorary Poster
Joined
Nov 10, 2016
Posts
333
Reaction
100
Points
145
Patulong naman, may code na ako pang show ng vowels pero hindi ito tama eh , please help .

The code :

Code:
Public Class Form1
    Dim pedro As String
    Dim I As Integer
    Dim nVowels As Integer
    Dim Vowels As String
    Dim invoker As String
    Dim axe As String
    Dim InputString As String
 
 
 
 
    Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 
        pedro = TextBox1.Text
        invoker = ListBox1.Items.Add(pedro)
 
 
 
 
    End Sub
 
 
    Public Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim count = ListBox1.Items.Count
        Dim vow As String
        Dim cons As String
        For counter As Integer = 0 To count
            Dim word As String = ListBox1.Items(counter)
            Dim vows As String = "aeiou"
            Dim baga As String = word.Substring(0, 1)
            If (vows.Contains(baga.ToLower)) Then
                vow = vow + 1
            Else
                cons = cons + 1
 
            End If
        Next counter
        TextBox2.Text = vow
        TextBox3.Text = cons
 
 
      
    End Sub
 
End Class
Public Class Form1
    Dim pedro As String
    Dim I As Integer
    Dim nVowels As Integer
    Dim Vowels As String
    Dim invoker As String
    Dim axe As String
    Dim InputString As String
 
 
 
 
    Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 
        pedro = TextBox1.Text
        invoker = ListBox1.Items.Add(pedro)
 
 
 
 
    End Sub
 
 
    Public Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim count = ListBox1.Items.Count
        Dim vow As String
        Dim cons As String
        For counter As Integer = 0 To count
            Dim word As String = ListBox1.Items(counter)
            Dim vows As String = "aeiou"
            Dim baga As String = word.Substring(0, 1)
            If (vows.Contains(baga.ToLower)) Then
                vow = vow + 1
            Else
                cons = cons + 1
 
            End If
        Next counter
        TextBox2.Text = vow
        TextBox3.Text = cons
 
 
      
    End Sub
 
End Class

Sana matulungan ninyo si akitch :'(
 
Status
Not open for further replies.
Back
Top