using arrays - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

using arrays

JabaKaba1988JabaKaba1988 Posts: 7Member
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?

[code] Const intNUMBER_OF_EMPLOYEES As Integer = 10

' 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)
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



  • seancampbellseancampbell Pennsylvania, USAPosts: 684Member ✭✭✭
    Hey, sorry it took me so long to get back to this post. I don't know if I am understanding exactly what you are trying to do? Also, it looks like your code got chopped off in the code block, only goes down to inside a for loop in your button click.

    So you want the 4 numbers of quarterly sales to save and then see if each quarter is higher or lower then the company average? or did you want to create a new company average based on all other entered sales info and the one you just grabbed?
Sign In or Register to comment.