Results 1 to 2 of 2
  1. #1
    susan is offline Member
    Join Date
    Jul 2007
    Posts
    44
    Rep Power
    0

    Default Help with matrix

    I'm doing a program in my Java class that I just need a tad bit of help with, I need to get the matrix arrays to get the data the right way...currently my program (without the print function)

    Java Code:
    import javax.swing.*;
    
    public class matrixArray {
    
    public static void main( String args[] )
    {
    int testScores[][] = new int[ 3 ][ 3 ];
    
    fillScores( testScores );
    
    System.exit( 0 );
    }
    
    public static void fillScores( int[][] ftestScores )
    {
    for( int row = 0; row < ftestScores.length; row++ )
    {
    for( int column = 0; column < ftestScores[ row ].length; column++ )
    // I'm using Input dialog boxes to retrieve the data from the user and I'm wondering how I will put the data into the arrays
    
    }
    
    }
    
    }
    Thanks

  2. #2
    cachi is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    As for your problem well you already have var row. Since this is an assignment I won't give you the exact answer.
    Just think about the indexes of the array cells. What could you use to access each cell? Remember array indexes start at 0.

    Greetings.

Similar Threads

  1. Help with dox matrix printer
    By Albert in forum Advanced Java
    Replies: 7
    Last Post: 09-06-2011, 08:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •