Click here to Skip to main content
15,881,753 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Hello. I am a new guy to C# (going for a master degree), so my teacher jumped streight to giving us homework. So, what I need to do is : to collect data about student's marks using jagged arrays.

1st: we must introduce data about the list of courses using a vector....

2nd: we must introduce data about the list of students using a vector...

3rd: we must generate a random irregulated parallelepiped using the marks of each student at each course...

Frankly, I have no ideea how to do this and my teacher isn't helping me either, he's not explaining very well, can you help me?


What I have tried:

C#
string [][][] stud = new string[4][5][8];


That's all I could come up with...
Posted
Updated 15-Oct-16 12:46pm
Comments
[no name] 15-Oct-16 12:54pm    
If your question really is "can you teach me programming in a forum posting?" the answer is no we cannot.

Start by reading your homework assignment, follow the steps and read the documentation for the classes that it tells you to use. You can find the explanation for jagged arrays, https://msdn.microsoft.com/en-us/library/2s05feca.aspx

1 solution

Jagged array is an array of n-dimensional arrays

VB
'a one dimensional array accepts no arrays, simply objects

Dim oneDArray() As Integer = {4, 5, 8}

VB
'a two dimensional array accepts only arrays and that of one dimensional

Dim twoDArray()() As Integer = {oneDArray, anotherOneDArray, etc1..}

Dim threeDArray()()() As Integer = {twoDArray, anotherTwoDArray, etc2..., another_etc2....}


threeDArray(0) returns twoDArray
threeDArray(1) returns anotherTwoDArray
threeDArray(2) returns etc2...
threeDArray(3) returns another_etc2...

threeDArray(0)(0) returns oneDArray
threeDArray(0)(0)(0) returns 4. (see above {4,5,8})
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900