Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW5-Summer07

Ask Questions on homework 5 here. Please enclose code with <code> </code> tags.

Question: Maybe I missed something, but I'm not sure how you get an index from a linked list (though I know how to do it for an array), and I don't know how to get the total length of the linked list (unless you use a count method from LLNode or treat it as a stack and get the size). Any leads?

Comment: Hahahaha this took me sometime to figure out. When I was adding the elements in the list it would add once but if I tried to do it twice it wouldn't do it. Apparently I was trying to foolishly add 'addElement' to the list and on successive loops it would try to add 'addElement' to itself, which ofcourse means that at the end the next attribute of 'addElement' would only be pointing to some other unique element in the list and 'addElement' was added only once.
Question: Perhaps I'm not paying attention, but I don't understand how the parameters are to be passed to the methods that we test in PictureTest. Do we specify the parameters through the Interaction Panel (and do we have to prompt the user for the input)? Do we place them as initialized values in the body of PictureTest? I'm assuming they are not read from an I/O file since we haven't touched on that. (But then we haven't touched on prompting the user for input, either.) Sorry if I missed hints fed to me...

Question: What is the best way to assign a random number to each node?

Question: In the doARandomPictureManipulation(), is each NODE supposed to have a different manipulation or just each different picture. Any pictures that are the same in mine always turn out with the same manipulation and I don't know how to fix that (if it needs to be fixed).



Link to this Page