Arrays

vargf

Member
Joined
Feb 15, 2006
Messages
13
Programming Experience
Beginner
Hi all
I have a 2 questions.

How to inicialized an Array for my Assignement Grader ?

I inicialized like this

Dim
listGrade() As String = {"A", "B", "C", "D", "F"}
-------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'here is the Array assignement.

listGrade("letterGrade") = Grade.ToString


'This is NumericUpDown to get score 0 to 100 maximun.


FinalGrade = TestScore.Text


'This is the RadioBottoms section to select the a average and the time liness
'moreover,
'Instead of using FinalGrade = FinalGrade + 0
'I use a short cut to save space
If (none.Checked) Then
FinalGrade += 0
End If
If (Average.Checked) Then
FinalGrade += 3
End If
If (AboveAverage.Checked) Then
FinalGrade += 5
End If
If (OnTime.Checked) Then
FinalGrade += 0
End If
If (OneToTwoDaysLate.Checked) Then
FinalGrade -= 3
End If
If (TwoPlusLate.Checked) Then
FinalGrade -= 5
End If


'I assigned
'This is the output result
'txtFinalGrade.Text = FinalGrade
If FinalGrade <= 100 And FinalGrade >= 90 Then
txtFinalGrade.Text = "Grade.ToString"
End If
Can anybody help me to fix this or ideas?
thanks
 
how to initialize? you already created and initialized the array with this statement:
Dim listGrade() As String = {"A", "B", "C", "D", "F"}
now you can access the array elements and get these string values:
listGrade(0) is "A"
listGrade(1) is "B"
etc
 
Back
Top