Loop help

electric-head

New member
Joined
Nov 17, 2005
Messages
1
Programming Experience
Beginner
Okay, I have a bit of a problem. I'm a total beginner at VB.NET and have been given an assignment that has to involve a loop. The idea of the program is to insert as many numbers into a form as you want and then calculate the average of the numbers.

I've managed to set up a simple form with a list box that I can enter numbers into with an input box.

The problem I have is the loop part (surprise, surprise :eek: ) I can't even fathom which kind of loop to use nevermind how to code it (Like I said I'm a total beginner).

Can anyone give me any hints on how to code this? I'm completely stuck!

EDIT: Oh and the reason it's split up into so many sub procedures is that I'm being tested on my ability to use them. Sadly they're the easiest bit!

VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Call listbox_add()
        Call averageprocedure()
        Call display()

    End Sub

    Sub listbox_add()
        Dim number As String
        number = InputBox("Item To Add:")
        ListBox1.Items.Add(number)
    End Sub

    Sub averageprocedure()

[B]LOOP GOES HERE?[/B]

    End Sub
 
Back
Top