Results 1 to 2 of 2

Thread: Test analysis program

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    1

    Test analysis program

    cant figure out how to get average score low score and high score

    All I have so far is how to bring up error messages
    Private Sub enterButton_Click(sender As System.Object, e As System.EventArgs) Handles enterButton.Click
    Dim scoreinteger As Integer

    Try
    scoreinteger = Integer.Parse(scoreText.Text)
    Catch ex As Exception
    MessageBox.Show("Please enter a numeric value", "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End Try

    Try
    scoreinteger = Integer.Parse(scoreText.Text)
    If scoreinteger > 100D Or scoreinteger < 0D Then
    MessageBox.Show("The test score must be between 0 and 100", "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

    End If
    Catch ex As Exception

    Its a running count of test scores not a certain number, any ideas?

  2. #2
    Junior Member
    Join Date
    Dec 2011
    Location
    Tullahoma, TN
    Posts
    20

    Re: Test analysis program

    Keep four static variables, one for max one for min, one for number of times the proc has been called, and one for current average. Each time the proc is called, after you get past the error conditions, multiply the current average by the number of times the proc has been called, add the current value to the result, increment your number of times variable, and divide the former by the latter. Then, if the number is less than the min or more than the max store it to the appropriate variable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width