2 Replies - 758 Views - Last Post: 10 December 2011 - 05:25 PM Rate Topic: -----

#1 nlocke123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-December 11

Arrays and sortedlist

Posted 10 December 2011 - 05:08 PM

A file has some lines, starting from the top, the first, the second, and the third lines are name, family name, and student ID for the first student in your class. Write a loop that reads the file and stores the data in arrays or lists. Write the code three ways using 1D arrays, 2d arrays, and sortedlists.
Is This A Good Question/Topic? 0
  • +

Replies To: Arrays and sortedlist

#2 nlocke123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-December 11

Re: Arrays and sortedlist

Posted 10 December 2011 - 05:17 PM

View Postnlocke123, on 10 December 2011 - 05:08 PM, said:

A file has some lines, starting from the top, the first, the second, and the third lines are name, family name, and student ID for the first student in your class. Write a loop that reads the file and stores the data in arrays or lists. Write the code three ways using 1D arrays, 2d arrays, and sortedlists.


I am very new to programming, I just need to know where to start with this problem. Am I simply writing it like this:

Dim FoundBoolean as Boolean
Dim ItemFoundBoolean as Integer

Do Until IndexInteger OR FoundBoolean = nametextbox.text
If ....?
Was This Post Helpful? 0
  • +
  • -

#3 nlocke123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-December 11

Re: Arrays and sortedlist

Posted 10 December 2011 - 05:25 PM

Or like this?

Structure Student
Dim FirstNameString as String
Dim LastNameString As String
Dim StudentID As Integer

End Structure
Dim IndexInteger As Integer
Private StudentArray(20) As Student

Do While StreamReader.Peek <> -1 And IndexInteger < 21
StudentArray(IndexInteger).FirstNameString = StudentStreamReader.Readline
" " "
IndexInteger += 1

Loop
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1