Public Class Form1 '//////////////CREATED BY ZEKI OZYILMAZ for CST112 'Declarations Dim reader1 As IO.StreamReader Dim file1 As IO.File Dim s As String '//// Computations Dim total As Double = 0.0 'Total of all values entered Dim many As Integer = 0 'Count of how many values Private Sub TInput_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TInput.MouseClick 'Displays pop-up box to enter file name in box Dim stringvar As String '/ Step1. Input stringvar = InputBox("Enter File name", "Enter File name") '//Step2. Process Me.TInput.Text = stringvar '///Step3. Output End Sub Private Sub BShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BShow.Click '//// Get the numbers onto the field and add to toal (also keep count) 'Step0. Declarations Dim t As String ' Next line from file. Dim n As Double '/ Step1. Input '//Step2. Process Do While (reader1.Peek() >= 0) t = reader1.ReadLine Me.LOutput.Items.Add(t) n = Val(t) total = total + n many = many + 1 If (reader1.Peek() < 0) Then Return End If Loop '///Step3. Output End Sub Private Sub BOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BOpen.Click '//////////Tells user the file has opened 'Step0. Declarations '/ Step1. Input s = Me.TInput.Text '//Step2. Process reader1 = IO.File.OpenText(s) '///Step3. Output Me.LOutput.Items.Add("File " & s & " is now open.") End Sub Private Sub BTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTotal.Click '//////////// Shows total of numbers added in file 'Step0. Declarations '/ Step1. Input '//Step2. Process '///Step3. Output Me.LOutput.Items.Add("The Total is: " & total) End Sub Private Sub BAverage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BAverage.Click '/////////// Shows average of total / numbers in file 'Step0. Declarations Dim average As Double '/ Step1. Input '//Step2. Process average = total / many '///Step3. Output Me.LOutput.Items.Add("The Average is: " & average) End Sub Private Sub BCloseF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BCloseF.Click reader1.Close() 'Close the file. Me.LOutput.Items.Add("File " & s & " is now closed.") End Sub End Class