Link to home
Create AccountLog in
Avatar of qsykes
qsykesFlag for United States of America

asked on

display the average number of books read for all readers in a session

I am trying to display the average number of books read for all readers in a session
*The average should be displayed in the summary*

This is how my code reads:

rivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub PointsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PointsToolStripMenuItem.TextChanged

        BonusPointsTextBox.Text = calcPoints(PointsToolStripMenuItem.Text)
    End Sub

    Private Function calcPoints(ByVal input As String) As Integer
        Dim points As Integer

        Try
            Dim numBooks As Integer = Integer.Parse(input)

            If numBooks <= 3 Then
                points = numBooks * 10
            Else
                points = 3 * 10
                If numBooks <= 6 Then
                    points = points + (numBooks - 3) * 15
                Else
                    points = points + (3 * 15)
                    points = points + (numBooks - 6) * 20
                End If
            End If
        Catch ex As Exception
        End Try

        Return points
    End Function
    Friend WithEvents AverageLabel As System.Windows.Forms.Label
    Friend WithEvents AverageTextBox As System.Windows.Forms.TextBox

    Private Sub SummaryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SummaryToolStripMenuItem.Click

    End Sub
End Class
ASKER CERTIFIED SOLUTION
Avatar of JimBrandley
JimBrandley
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of qsykes

ASKER

Please close this wuestion. This is not the right solution.