Results 1 to 2 of 2
  1. #1
    smith999 is offline Member
    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Default 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
    dx=dy=5, dx/2=dy/2=2.
    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??
    THANK YOU!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default 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.

Similar Threads

  1. Java Assignment
    By lance215 in forum New To Java
    Replies: 1
    Last Post: 06-15-2012, 12:11 AM
  2. java assignment
    By drewjordan in forum New To Java
    Replies: 9
    Last Post: 01-15-2012, 11:44 PM
  3. Java Assignment Help
    By nve5009 in forum New To Java
    Replies: 4
    Last Post: 04-27-2011, 06:36 AM
  4. Need Help with Java Assignment
    By smurf67 in forum New To Java
    Replies: 4
    Last Post: 03-26-2011, 10:25 AM
  5. My java assignment -- please help me !
    By java_beginner1 in forum New To Java
    Replies: 11
    Last Post: 05-20-2010, 04:00 PM

Posting Permissions

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