Okay, here is my problem. The instructions are I would have to store the minimum points and grades in a five row two column array. The procedure should display the grade corresponding to the number of points entered by the user.
Minimum Points Maximum Points Grades
0 299 F
300 349 D
350 399 C
400 449 B
450 500 A
This is the code I have, and the book is somewhat helpful..my problem is when I enter the points, nothing is being displayed..what I am I doing wrong? Also, we have not discussed the Exit format yet..Any help and specific explaination is greatly appreciated.
Dim strGrades(,) As String = {{"F", "0"},
{"D", "300"},
{"C", "350"},
{"B", "400"},
{"A", "450"}}
Dim intSearchPoints As Integer
Dim intRow As Integer
Dim intNumRows As Integer
Dim intFound As Integer
Integer.TryParse(txtPoints.Text, intSearchPoints)
intRow = 0
intFound = "600"
intNumRows = strGrades.GetUpperBound(0) + 1
Do Until intFound = "500" OrElse intRow = intNumRows
If strGrades(intRow, 0) = intSearchPoints Then
intFound = "500"
Else
intRow = intRow + 1
End If
Loop
If intFound = "500" Then
lblGrade.Text = strGrades(intRow, 1).ToString
Else
lblGrade.Text = "Invalid Points"
End If