Hey! I'm working on this solution that wants me to code an application that displays the highest score earned on the midterm and then the highest score on the final exam. This is waht I have so far but it is not working...
Option Explicit On
Option Strict On
Public Class MainForm
Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
Me.Close()
End Sub
Private Sub xDisplayButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xDisplayButton.Click
' displays the highest score earned on the midterm
' and the highest score earned on the final
' declare arrays and fill with data
' midterm scores are in the first column
' final scores are in the second column
Dim scores(,) As Integer = {{89, 98}, _
{78, 45}, _
{67, 89}, _
{90, 99}, _
{91, 70}, _
{75, 76}}
Dim subscript As Integer
Dim highestMidterm As Integer = scores(0, 0)
Dim highestFinal As Integer = scores(0, 1)
Dim midtermLabel As Integer
Dim finalLabel As Integer
' search for highest values
Do Until subscript = 6
subscript = subscript + 1
For subscript1 As Integer = 1 To 5
If scores(subscript1, 0) > highestMidterm Then
highestMidterm = scores(subscript1, 0)
End If
Next subscript1
For subscript2 As Integer = 1 To 5
If scores(subscript2, 1) > highestFinal Then
highestFinal = scores(subscript2, 1)
End If
Next subscript2
Loop
' display highest values
midtermLabel = highestMidterm
finalLabel = highestFinal
End Sub
End Class
I'm having trouble getting this to work, I know there are some mistakes but I'm not sure where? Any solutions would be appreicated!