I am working on a class project that calls for a test score calculator that calculates and displays the score total, score count, and average score. If the user clicks the Display scores button, the application sorts the scores and displays them in a message box. There is also a Clear button to have all entries removed. And an exit button.
I had worked on this for hours and I was just told that I'm doing it all wrong. This is my first major vb project. I need some help with this as the project is due tomorrow. Thanks
Here is what I have so far.
Public Class Form1
Dim highScore As Integer
Dim Score As Integer
Dim totalScore As Integer
Dim numberScores As Integer
Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
Score = txtTestScore.Text
totalScore = totalScore + Score
numberScores = numberScores + 1
If (Score > highScore) Then
highScore = Score
End If
txtBest.Text = highScore
Dim averageScore As Decimal = Math.Round(totalScore / numberScores, 2)
txtAverage.Text = averageScore
End Sub
End ClassPublic Class Form1
Dim highScore As Integer
Dim Score As Integer
Dim totalScore As Integer
Dim numberScores As Integer
Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
Score = txtTestScore.Text
totalScore = totalScore + Score
numberScores = numberScores + 1
If (Score > highScore) Then
highScore = Score
End If
txtBest.Text = highScore
Dim averageScore As Decimal = Math.Round(totalScore / numberScores, 2)
txtAverage.Text = averageScore
End Sub
End Class