

1 If studentGrade >= 90 Then 2 resultLabel.Text = "A" ' display "A" 3 Else 4 If studentGrade >= 80 Then 5 resultLabel.Text = "B" ' display "B" 6 Else 7 If studentGrade >= 70 Then 8 resultLabel.Text = "C" ' display "C" 9 Else 10 If studentGrade >= 60 Then 11 resultLabel.Text = "D" ' display "D" 12 Else 13 resultLabel.Text = "F" ' display "F" 14 End If 15 End If 16 End If 17 End If

Else statements that correspond to the pseudocode in Fig.

1 If student's grade is greater than or equal to 90 then 2 Display "A" 3 Else 4 If student's grade is greater than or equal to 80 then 5 Display "B" 6 Else 7 If student's grade is greater than or equal to 70 then 8 Display "C" 9 Else 10 If student's grade is greater than or equal to 60 then 11 Display "D" 12 Else 13 Display "F"įig 4.5. Else statements that display a letter grade based on a numeric grade value. The pseudocode may be written in Visual Basic as shown in Fig. 4.4 displays "A" for exam grades greater than or equal to 90, "B" for grades in the range 80–89, "C" for grades in the range 70–79, "D" for grades in the range 60–69 and "F" for all other grades. Else statements test for multiple conditions by placing If. Visual Basic 2010 How to Program, 5th Edition
