I have a list of 30 scores ranging from 0 to 49 that I need to sort into an array.
They need to be sorted as following:
frequencies(0) = scores < 10
frequencies(1) = scores >10 and <20
frequencies(2) = scores >20 and <30
frequencies(3) = scores >30 and <40
frequencies(4) = scores >40 and <50
so far, I have stored the text file into a temporary array and converted it to an integer (as follows)
***
***
My question is, what steps do I need to take in order to store the correct scores from the text file into the frequencies array? Each score is stored on its own line in the text file.
They need to be sorted as following:
frequencies(0) = scores < 10
frequencies(1) = scores >10 and <20
frequencies(2) = scores >20 and <30
frequencies(3) = scores >30 and <40
frequencies(4) = scores >40 and <50
so far, I have stored the text file into a temporary array and converted it to an integer (as follows)
***
Code:
Dim temp() as String = IO.File.ReadAllLines("Scores.txt")
Dim Scores(30) as Integer
Dim frequencies(4) as Integer
'convert to string into integer
For i as Integer = 0 To temp.Count - 1
scores(i) = CInt(temp(i))
Next
My question is, what steps do I need to take in order to store the correct scores from the text file into the frequencies array? Each score is stored on its own line in the text file.
Comment