Results 1 to 2 of 2
Thread: Java Assignment help?
- 11-24-2012, 12:20 AM #1Member
- Join Date
- Oct 2012
- Rep Power
Java Assignment help?
hi so im super stuck on this part of my assignment, if anyone could help me get started id greatly appreciate it :)
Create a method that would return a 2D sub-array of a 2D array of integers. Given a location (i,j) and
two odd numbers dx and dy, return the sub-array centered at (i,j) extending from i-dx/2 to i+dx/2 and
from j-dy/2 to j+dy/2. Note: the previous divisions are integer divisions returning an integer; for
Your method should have the header:
public static int  snip(int  a,int i, int j, int dx, int dy)
If i, j, i-dx, j-dy, i+dx, j+dy are out of bounds return null. For dx=3, dy=3 the indices should be:
(there is a matrix posted here but i cant seem to copy and paste, but the values in order starting from the top left going right are:
((i-dx/2),(j-dy/2)) (i,(j-dy/2)) ((i+dx/2),(j-dy/2))
((i-dx/2),j) (i,j) ((i+dx/2),j)
((i-dx/2),(j+dy/2)) (i,(j+dy/2)) ((i+dx/2),(j+dy/2))
does that make any sense??
Re: Java Assignment help?
You may wish to reply to help given in your previous post on this forum as that can motivate folks to help you further. We like to know that are efforts aren't for naught, that you actually read and digest what we have posted.
- By lance215 in forum New To JavaReplies: 1Last Post: 06-15-2012, 12:11 AM
- By drewjordan in forum New To JavaReplies: 9Last Post: 01-15-2012, 11:44 PM
- By nve5009 in forum New To JavaReplies: 4Last Post: 04-27-2011, 06:36 AM
- By smurf67 in forum New To JavaReplies: 4Last Post: 03-26-2011, 10:25 AM
- By java_beginner1 in forum New To JavaReplies: 11Last Post: 05-20-2010, 04:00 PM