Arraysdriver

Arraysdriver - System.out.println("Matrix 'R' ");...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//Matt Hergenrether //CS 2133 //February 25, 2009 public class Arraysdriver { public static void main(String[] args) { //declaring variables double count = 1.00; int leftRow; int leftCol; int rightRow; int rightCol; double [][] Left; double [][] Right; leftRow = 4; leftCol = 5; rightRow = 5; rightCol = 6; //initializing the two arrays Left = new double [leftRow][leftCol]; Right = new double [rightRow][rightCol]; //filling up the arrays with junk data for(int k = 0; k <leftRow; k++ ) { for(int j = 0; j<leftCol; j++) { Left[k][j] = count; count = count + 1.00; } } for(int x = 0; x <rightRow; x++ ) { for(int y = 0; y<rightCol; y++) { Right[x][y] = count; count = count + 1.00; } } //declares object and sends data to Multidimarrays class Multidimarrays test = new Multidimarrays (leftRow, leftCol, rightRow, rightCol, Left, Right);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println("Matrix 'R' "); // prints out the Right matrix for(int a = 0; a <rightRow; a++ ) { for(int b = 0; b<rightCol; b++) { System.out.print( Right[a][b] + " "); if( b == (rightCol - 1)) { System.out.println(""); } } } System.out.println(""); System.out.println("Matrix 'L' "); // prints out the Left matrix for(int c = 0; c<leftRow; c++ ) { for(int d = 0; d<leftCol; d++) { System.out.print( Left[c][d] + " "); if( d == (leftCol-1)) { System.out.println(""); } } } System.out.println(""); System.out.println("Matrix 'X' "); // prints out the X matrix for(int e = 0; e <leftRow; e++ ) { for(int f = 0; f<rightCol; f++) { System.out.print(test.mult()[e][f] + " "); if( f == (rightCol-1)) { System.out.println(""); } } } } }...
View Full Document

This note was uploaded on 09/28/2011 for the course CS 2133 taught by Professor Rao during the Fall '10 term at Oklahoma State.

Page1 / 2

Arraysdriver - System.out.println("Matrix 'R' ");...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online