Results 1 to 6 of 6
- 11-01-2011, 11:31 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 11
- Rep Power
- 0
help with multidimesional array qn
b) Given two equal sized double arrays : X, Y initialized with some non sorted numbers, and a third equal sized boolean array Z . Write a Java method to check the equality of corresponding elements of array X and Y elements , and put the result into the corresponding index element of boolean array Z . [10 marks]
- 11-01-2011, 12:30 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Re: help with multidimesional array qn
So, Z[j]= X[j] == Y[j]? If so, put a loop around it and pass me the 10 marks.
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-01-2011, 01:09 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 11
- Rep Power
- 0
Re: help with multidimesional array qn
public boolean findMacthes([][]x,[][]y){
if([][]x!=[][]y){
return null;
}
for(int a = 0;a<x.length;a++){
for(int c = 0 ;c<y.length;c++){
result [a][c] = true;
}
}
}
return result;
}
- 11-01-2011, 01:11 PM #4
Member
- Join Date
- Oct 2011
- Posts
- 11
- Rep Power
- 0
Re: help with multidimesional array qn
public boolean findMacthes([][]x,[][]y){
if([][]x!=[][]y){
return null;
}
boolean [][]Z=new boolean [x.length,y.length]
for(int a = 0;a<x.length;a++){
for(int c = 0 ;c<y.length;c++){
Z[a][c] = true;
}
}
}
return z[][];
}
- 11-01-2011, 01:22 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Re: help with multidimesional array qn
Did your compiler like it? I guess not; don't just guess what the Java language should be in your imagination; read a textbook.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-01-2011, 02:23 PM #6
Senior Member
- Join Date
- Aug 2011
- Posts
- 248
- Rep Power
- 2
Similar Threads
-
How to convert array of Objects into array of Strings
By elenora in forum Advanced JavaReplies: 1Last Post: 06-10-2011, 03:48 PM -
Display Array on another class after extracting from txt file and into array problem
By jonathan920 in forum NetBeansReplies: 0Last Post: 05-12-2011, 07:04 PM -
Variable of an object in an array compared to an element of another array?
By asmodean in forum New To JavaReplies: 23Last Post: 09-07-2010, 08:12 PM -
Trying to make an array list // inserting an element to middle of array
By javanew in forum New To JavaReplies: 2Last Post: 09-06-2010, 01:03 AM -
How to add an integer to a array element and the store that backinto an array.
By Hannguoi in forum New To JavaReplies: 1Last Post: 03-31-2009, 06:40 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks