Results 1 to 4 of 4
  1. #1
    Track13 is offline Member
    Join Date
    Nov 2012
    Posts
    11
    Rep Power
    0

    Default Professor confuse me, can someone explain this for me??

    My professor confuse me. Can someone just elaborate on what my professor wants?

    public*Album(*int*capacityParam*)
    This constructor enables the program using*Album to set up an Album that will have the
    accept up to the number of Picture s given by the value of capacityParam
    The Album class will have 3 public methods: Two have the same name but different pa*
    rameters! (The technical term for such different methods is "polymorphic") They are re*
    ally different methods.

    This is what I have for my constructor
    public class Album
    {
    private int nPictsInAlbum;
    private int capacity;
    private Picture[] pictArray;

    public Album(int capacityParam )
    {
    capacity = capacityParam;
    this.pictArray = new Picture[capacity];
    this.nPictsInAlbum = 0;
    //System.out.println("Album ( " + capacityParam + " ) constructor called.");
    }

    public*boolean*addPicture(Picture*thePicture)
    This method tries to add the given Picture to the Album, so when the*Album*is
    shown (in the future!), the given Picture*appears at the (right) end. It returns true if
    the Picture is successfully added and false otherwise.

    public*void*explore()
    A new Picture is made whose height is the max of the heights, and width is the
    sum of the widths of the stored Picturess. The Pictures in the Album so far are
    copied into a new Picture and that Picture is displayed by calling the
    explore() method on it. All the added Picture copies should start at the top of
    the new Picture and be laid out horizontally, with no overlaps or gaps.

    public*boolean*addPicture(Picture*thePicture,*int* where)
    Instead of adding the given Picture at the end, this method inserts it at the posi*
    tion given by the where parameter value. That value should be between 0 and
    nPictsInAlbum
    When it is 0, the given Picture is inserted at the beginning and the other Pic*
    tures are shifted right to make the space for it. When it is nPictsInAlbum*, it just
    adds the given Picture at the right end. (When in*between, it adds the given Picture in*be*
    tween the whereth Picture and the Picture after that one.)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: Professor confuse me, can someone explain this for me??

    Please go through the Forum Rules -- particularly the third paragraph. Also go through Guide For New Members and BB Code List - Java Programming Forum and then edit your post accordingly (to change the subject line, click "Go Advanced").

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: Professor confuse me, can someone explain this for me??

    http://www.cs.albany.edu/~sdc/CSI201...Fal12Proj5.pdf
    Due "December. May 8, 11:59 PM? Somebody relied too much on copy/paste.
    http://www.cs.albany.edu/~sdc/CSI201...roj4/Proj4.pdf

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Track13 is offline Member
    Join Date
    Nov 2012
    Posts
    11
    Rep Power
    0

    Default Re: Professor confuse me, can someone explain this for me??

    I was not asking for anyone to do the work for me but to elaborate more on what my professor is asking. I have each of the methods written down. I am just confuse on how I should look at it.

    This is what I written down for how I should look at each of the methods.

    Method 1:
    is to add the Picture and when the Picture is added it will appear to the right of the Album

    Method 2:
    the new Picture height is the MAX height and sum up each of the Pictures width
    once the Pictures are copied to the new Picture then the explore method will be called
    each of the Picture should display horizontally without any overlaps

    Method 3:
    add the given Picture to wherever the parameter value set it
    value should be between 0 - nPictsInAlbum
    once a Picture is add each of the Pictures are shifted to the right to make space for the other Pictures

    Am I on the right track with understanding what my professor wants?

Similar Threads

  1. i m so confuse in mutex process and thread..
    By vivek6569 in forum New To Java
    Replies: 1
    Last Post: 05-03-2011, 07:51 AM
  2. i m so confuse in garbage collection
    By vivek6569 in forum New To Java
    Replies: 3
    Last Post: 05-03-2011, 07:39 AM
  3. Replies: 2
    Last Post: 12-13-2010, 01:34 PM
  4. Replies: 3
    Last Post: 12-13-2010, 07:22 AM
  5. Database Normalization, a little confuse
    By mine0926 in forum JDBC
    Replies: 4
    Last Post: 08-28-2010, 01:32 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
  •