Public Class Form1 Dim many As Integer = 0 Dim total As Integer = 0 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '////accumulate numbers into a total '///declarations Dim n As Integer 'the next input # 'input: get # from textbox1 n = Val(Me.TextBox1.Text) 'processing:add n to total total = total + n many = many + 1 'output: display the total(so far). Me.ListBox1.Items.Add("the total (so far) is: " & Format(total)) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'compute and display the average Dim avg As Double 'input:(none) '2.process:compute the average=total/many avg = total / many '3. output:display it Me.ListBox1.Items.Add("the average is " & avg) End Sub End Class