VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
using arrays Posted by JabaKaba1988 on 7 Nov 2008 at 11:36 PM
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?


 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

Report
Re: using arrays Posted by seancampbell on 11 Nov 2008 at 6:32 AM
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?

-firesickle.com



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.