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

Questions on HW5-Fall07

Post your questions for HW5 here.

For the third method we have to write for the homework, is this the proper constructor? public void replaceWithModifications(PositionedSceneElement findelement, double[] types){

Also, how do I traverse the array that is inputed? Right now I have: for (int i= 1; i<=types.getLength();i++) {. That, however, does not work because it says there is no getLength() method in the class double. How do I go about traversing the array? Thanks!


If I am working in the PositionedSceneElement class, how do I use the picture methods on the input nodes?

Error: C:\cs1316\java-source\PositionedSceneElement.java:191: cannot find symbol
symbol : method negate()
location: class PositionedSceneElement

I don't know how to work around this. Even though the node will be a picture, I can't find it as a node and then edit it as a picture.

For the replaceWithModification(findelement,int type), the instructions say to replace findelement with a new node. Instead, can we just replace findelement's myPic with a the modified Picture?

I am sorry, words don't do me good. This question wording is too complicated for me, in the final product, I am not sure what we're suppose to have shown. Three separate pictures what shows up at the same time or mayhaps something else?

Will oldelement/findelement ever be the last node in the list? If so, how can I manipulate the last element (b/c with "while current.getNext() != null", the loop breaks before changes to the last node can be made)?



I have all of my code written including all of the methods in PositionSceneElement but only one of them works, The second,(replaceWithModification). The other two have the same error stemming from the same spot in our code, and the error is a null pointer exception in the drawMeOn method, called by drawFromMeOn, from the PositionedSceneElement. Somehow i think that the 'this' statement in that part of the code is being set to null when we locate the node we want to replace and try and replace it with another node(findAndReplaceRepeat method), or replace it with numerous modified nodes (replaceWithModifications method). I cannot find how or why we have a null pointer exception but i think that is the only error preventing me from finishing this assignment

Do we have to show all 4 pics in 1 "world" or in 4 different "worlds" ?????

When I run my PictureTest class, it shows all 4 windows. But the problem is that in my second method,it uses the modified linked list from the first method. So, in my third window, I don't see the original image modified but the second image already modified by the first method, modified again. How is that possible?

In total we need 1 picture in 4 different worlds, right? And that pic must be modify according to the hw, right?



Link to this Page