Private Sub TextBox5_TextChanged(sender As System.Object, e As System.EventArgs) Handles TxtAverage.TextChanged
' This prodecure calculates the average test score of five scores and displays the average in lblAverage.
Dim TestScore1 As Integer ' Test Score
Dim TestScore2 As Integer ' Test Score
Dim TestScore3 As Integer ' Test Score
Dim TestScore4 As Integer ' Test Score
Dim TestScore5 As Integer ' Test Score
Try
' Get the scores entered by the user
TestScore1 = TxtTestScore1.Text
TestScore2 = TxtTestScore2.Text
TestScore3 = TxtTestScore3.Text
TestScore4 = TxtTestScore4.Text
TestScore5 = TxtTestScore5.Text
' Calculate the average score
lblAverage.Text = (TestScore1 + TestScore2 + TestScore3 + TestScore4 + TestScore5) / 5
This post has been edited by AdamSpeight2008: 06 October 2012 - 02:19 PM
Reason for edit:: Someone forgot to use the CODE Tags.

New Topic/Question
Reply



MultiQuote





|