🔒 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
  • 870
    Views
  • 3
    Participants
Last reply from:
Made-In-Heaven

Online now

Members online
414
Guests online
669
Total visitors
1,083

Forum statistics

Threads
2,275,527
Posts
28,963,844
Members
1,232,834
Latest member
satoshidesu01
Back
Top