How to store values into a 2D array from a sample dataset?
Hi, the following segment of code basically creates a 2D array into which values can be assigned:
public class Assn3
{
TextFile inFile = new TextFile (true, "input.txt");
readFromFile(inFile);
//-
public array readFromFile(TextFile inputFile)
{
while(!(iFile.eof())
{ int studentNo = TextFile.inputFile.readInt();
TextFile.inputFile.skipWhiteSpace();
int quizNo = TextFile.inputFile.readInt();
for (i=1;i<=studentNo;i++)
{
for (j=1;j<=quizNo;j++)
{
int input = TextFile.inputFile.readInt();
//Store the number appropriately in a 2D array...
}
TextFile.inputFile.skipWhiteSpace();
}
}
}
I have a sample dataset which is saved as inputFile.txt in the same source folder.
My question is: how do I go about actually storing the values into the array?
Thanks in advance,

