Results 1 to 4 of 4
- 12-07-2012, 05:36 PM #1
Member
- Join Date
- Nov 2012
- Posts
- 11
- Rep Power
- 0
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.)
- 12-07-2012, 06:28 PM #2
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").
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 12-07-2012, 06:34 PM #3
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
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 12-08-2012, 01:38 AM #4
Member
- Join Date
- Nov 2012
- Posts
- 11
- Rep Power
- 0
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
-
i m so confuse in mutex process and thread..
By vivek6569 in forum New To JavaReplies: 1Last Post: 05-03-2011, 07:51 AM -
i m so confuse in garbage collection
By vivek6569 in forum New To JavaReplies: 3Last Post: 05-03-2011, 07:39 AM -
Please Explain me how i got this output.. I am new to java .. so please Explain me...
By vicky82 in forum New To JavaReplies: 2Last Post: 12-13-2010, 01:34 PM -
Please Explain me how i got this output.. I am new to java .. so please Explain me...
By vicky82 in forum New To JavaReplies: 3Last Post: 12-13-2010, 07:22 AM -
Database Normalization, a little confuse
By mine0926 in forum JDBCReplies: 4Last Post: 08-28-2010, 01:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks