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

Status
Not open for further replies.
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.

About this Thread

  • 4
    Replies
  • 879
    Views
  • 3
    Participants
Last reply from:
Made-In-Heaven

Trending Topics

Online now

Members online
1,067
Guests online
1,568
Total visitors
2,635

Forum statistics

Threads
2,285,485
Posts
29,030,575
Members
1,218,489
Latest member
fritz91
Back
Top