How to create custom 2 dimensional array data structure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ulnanewbie
    New Member
    • Feb 2010
    • 5

    How to create custom 2 dimensional array data structure

    Please provide me suggestions or any pointers.

    I want to create a user defined data structure, which will be a 2 dimensional array such that each individual square of this 2-dimensional array will also store the score and the grades. ( Iam using VB.NET)

    More details:



    for example: There is an 2 dimensional array with 3 columns and 2 rows, I want to fill each of the

    (0,0);(0,1);(0, 2) with their own score (Integer type) and grades (String Type).

    And this is same for the rest of the squares i.e. (1,0);(1,1);(1, 2) and (2,0);(2,1);(2, 2)



    After creating such custom data structure: "CustomArra y", I should be able to create the instance of this custom data structure (which will be a class) and code something like this:

    Dim objCustomArray as CustomArray

    objCustomArray = New CustomArray

    for i as Integer =0 to 3

    objCustomArray( 0,i).SetScore(1 )
    objCustomArray( 0,i).SetGrade(" Good")

    Next

    for i as Integer =0 to 3

    Dim myVal as Integer = objCustomArray( 0,i).GetScore()

    Dim myGrade as String = objCustomArray( 0,i).gettGrade( )

    Next
  • ulnanewbie
    New Member
    • Feb 2010
    • 5

    #2
    can we create 2 dimensional array of hashes

    I have to create a use defined data structure where I need to store
    an integer and a string value in each square of a 2 dimensional array.

    I was wondering if it is possible to store hash data structure? something 2 dimensional array of hashes.

    I know that we can add user defined objects to the ArrayList, is something like this possible with 2 dimensional array as that can be one more solution.

    Please suggest.

    Thanks.

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Please read the posting guidelines.

      We can't help you with your schoolwork.
      Please don't double post your messages. Your two threads have been merged.

      Comment

      Working...