VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 7620 ClientLeft = 60 ClientTop = 345 ClientWidth = 8340 BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 7620 ScaleWidth = 8340 StartUpPosition = 3 'Windows Default Begin VB.CommandButton cmdCount Caption = "Count Vowels" Height = 735 Left = 1680 TabIndex = 4 Top = 1200 Width = 4215 End Begin VB.TextBox txtWord Height = 615 Left = 2160 TabIndex = 3 Top = 240 Width = 4695 End Begin VB.PictureBox picOut Height = 4335 Left = 120 ScaleHeight = 4275 ScaleWidth = 7875 TabIndex = 1 Top = 2040 Width = 7935 End Begin VB.TextBox Text1 BackColor = &H0000C000& Height = 735 Left = 120 TabIndex = 0 Text = "Your Name goes Here" Top = 6600 Width = 8055 End Begin VB.Label Label1 Caption = "Enter a Word:" Height = 495 Left = 240 TabIndex = 2 Top = 360 Width = 1815 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub print_one_letter_count(lettername As String, total As Integer) picOut.Print "Letter "; lettername; picOut.Print ": "; picOut.Print total End Sub Private Sub cmdCount_Click() Dim a As Integer, e As Integer, i As Integer, o As Integer, u As Integer Dim word As String word = txtWord.Text word = UCase(word) Dim word_size As Integer word_size = Len(word) Dim count As Integer 'make all the vowel counts zero a = 0 e = 0 i = 0 o = 0 u = 0 For count = 1 To word_size 'step one: get letter number count out of word Dim letter As String letter = Mid(word, count, 1) If letter = "A" Then a = a + 1 ElseIf letter = "E" Then e = e + 1 ElseIf letter = "I" Then i = i + 1 ElseIf letter = "O" Then o = o + 1 ElseIf letter = "U" Then u = u + 1 End If Next count Call print_one_letter_count("A", a) Call print_one_letter_count("E", e) Call print_one_letter_count("I", i) Call print_one_letter_count("O", o) Call print_one_letter_count("U", u) End Sub