using arrays to store and divide

Discussion in 'Visual Basic ( VB )' started by jabagirl1988, Nov 8, 2008.

  1. jabagirl1988

    jabagirl1988 New Member

    Joined:
    Nov 8, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    i want to store the employees quarter sales and at the same time i want them to average with the companies quarter sales any ideas?

    [​IMG]
    Code:
     Const intNUMBER_OF_EMPLOYEES As Integer = 10
        Const intMAX_EMPLOYEE As Integer = intNUMBER_OF_EMPLOYEES - 1
    
    
        ' class level variables
        Private Names(intMAX_EMPLOYEE) As String
        Private quarter1(9) As Single
        Private quarter2(9) As Single
        Private quarter3(9) As Single
        Private quarter4(9) As Single
    
        Private Sub txtQuarter1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtQuarter1.Validating, txtQuarter4.Validating, txtQuarter3.Validating, txtQuarter2.Validating
            Dim input As String = CType(sender, TextBox).Text
            If IsNumeric(input) Then
                Dim number As Integer = CInt(input)
            Else
                MessageBox.Show("Please enter an integer.")
                e.Cancel = True
            End If
    
        End Sub
    
        
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            Dim intCount As Integer
    
            For intCount = 0 To intMAX_EMPLOYEE
                Names(intCount) = TextBox1.Text
    
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice