Public Class Form1 '///// CST112 B.A.Martin - avg pgm '//// global Dim many As Integer = 0 'how many values Dim total As Integer = 0 'Total (so far) Private Sub benter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles benter.Click '/// Accumulate numbers into total '0. Declarations, init Dim nextvalue As Integer 'the next input # '1. INPUT: get # from inext nextvalue = CInt(Me.inext.Text) '2. process: add n to total total = total + nextvalue many = many + 1 '3. output: Display the total (so far). Me.oresults.Items.Add("the total so far is: " _ & Format(total)) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Avarage.Click '//// compute and display the average Dim avg As Double '1. input use Global varibles: total , many '2. process: compute the average = total / many avg = total / many '3. output: display it. Me.oresults.Items.Clear() Me.oresults.Items.Add("the average is " & avg) End Sub End Class