Having problem make last if an statement work in the code. the variables in the if statment are doubles but the ide keep telling i need a proceeding if statement. but is already there
it is in the last if statement of the code
Public Class Form1
Dim Totals As New List(Of Double)
Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclear.Click
txtbxscore.Clear()
txtbsbest.Clear()
txtbxnumber.Clear()
txtbxaverage.Clear()
Totals.Clear()
End Sub
Private Sub btnaverage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaverage.Click
Dim BestScore As Double
Dim Scores As Double
Dim AverageScore As Double
Dim FutureJob As Image = My.Resources.future
Dim Delivery As Image = My.Resources.Delivery
Dim Fries As Image = My.Resources.Fries
Dim Doctor As Image = My.Resources.Doctor
Dim Pilot As Image = My.Resources.Pilot
If IsNumeric(txtbxscore.Text) AndAlso Val(txtbxscore.Text) >= 0.0 AndAlso Val(txtbxscore.Text) <= 100.0 Then
Scores = Val(txtbxscore.Text)
Else : MessageBox.Show("Either a nonnumeric value or not a number between 0 and 100")
txtbxscore.Clear()
txtbsbest.Clear()
txtbxnumber.Clear()
txtbxaverage.Clear()
Totals.Clear()
txtbxscore.Select()
End If
Totals.Add(Scores)
AverageScore = Totals.Sum / Totals.Count
BestScore = Totals.Max()
txtbxnumber.Text = Totals.Count
txtbsbest.Text = Math.Round(BestScore, 2)
txtbxaverage.Text = Math.Round(AverageScore, 2)
If (AverageScore) > 70.0 Then FutureJob = Fries
ElseIf (AverageScore) >= 70.0 And (AverageScore) > 80.0 Then FutureJob = Delivery
ElseIf (AverageScore) >= 80.0 And (AverageScore) > 90.0 Then FutureJob = Pilot
ElseIf (AverageScore) >= 90.0 And (AverageScore) < 100.0 Then FutureJob = Doctor
Else FutureJob = future
End If
picbxfuture.Image = FutureJob
End Sub
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub
End Class