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

Questions on HW3-Spring08

Ask Questions on HW3 here:
Question: So why can't I open the HW3 java file?

Question: I am so confused on this homework, I don't know where to start. Can someone go over it in class Wednesday, please.

I agree with the above. I have a general outline of what each program should have in it from the instructions, but have no clue where to go from there. Recitation wasnt much help in putting all the three together. I dont know how we are supposed to know how to write these programs. The linked list guides dont go over enough of how to write the programs nor does the book.

Question: Do the constructors in ContactEntry need to reference,, etc or is "this" already implied?

Questions: When I try to "return name" in my getName method in ContactEntry, the compiler can't find the variable "name." My variables are defined in both of my constructors, do I need to do it somewhere else as well?

Question: What's the best way to do the toString method for ContactNode? Should I just extend ContactEntry and use its get() methods, or find a way to return a string from "data" in ContactNode?

Question: For the methods in ContactList that return a boolean, what should I use as my criteria to determine if the method was successful?

Question: I'm not sure if this is only temporary, but I can't get the and to come up in the code archive of t-square.
Question: Back to methods that return a boolean - so I don't even have to include a return statement in the method, it just does everything automatically?

Question: What that person was probably referring to was that on Prof. REMOVED's prism account, the file is "Forbidden". I was looking for example help on the hw... because I know he uses some of the methods in his example... but his files aren't public or something.

Question: When I try to compile code with public setName (String name), I get an error saying that I need a return type. What return type do I need?

Question: If I wanted to see if the next node is equal to "node1", how would I do it? "if (getNext().equals(node1)) {}" doesn't work; is there something similar that does? This is for the delete() method, and I'm trying to set the current node's "next" to the next node's "next".

Question: Are we supposed to be providing actual names and phone numbers, like he provided in the TA montage example?

Question: Could you explain how to create real data to test the methods?

Question: How can you address a name or number field in a ContactNode for the search method in ContactList? I can't figure out how to go from node to data to ContactEntry, and access the strings.

Question: For the delete( node ) method, I dont understand the theory behind it. If you are given a node to delete, wouldnt you have to know the node before that one too so you can set the before =

Question: In ContactEntry, for setName(String name) do we write = name or String name = ""?

Question: For the toString method in ContactList, should the method build an array of strings and return that, or is there a more elegant way to do it?

In the add() method of ContactList, the following statement keeps giving me a list of NullPointerExceptions:
if (head.equals(null)) {head = contactToInsert;}
Any suggestions?|

In ContactNode, do we use the word data as the variable?

On the extra credit portion when you ask to sort by name, phone and email do you mean to put them in alphabetical order or just display them in terms of their section section? Because if it were to be in alphabetical order how would I be able to do that with the phone numbers considering they are numbers?

What is the difference between "while (current.getNext() != null)" and "while(current != null)"?

On the insertAfter and delete methods, are we supposed to have it return true and false?

In ContactList, are we supposed to be coding a new LinkedList?

I need help with the searchByName. You start with String name = name, right? Then what?

For the fourth above question, which one should you use for insertAfter?

Link to this Page