Alright, here's what I've got going on: I've got to add items (integers) to a linked list. I'll keep adding integers until I feel I have enough in there.
When -1 is entered, the loop stops and I need to then print out the linked list.
So far I've gotten the input part down just fine (I'll still have you take a look at it since I'd like feedback on how I decided to do it) but it's the print that I'm having issues with.
Here's what I've got:
Declares a new LinkedList
Asks for input until -1 is entered.
Now I'd like to create a print method... something that will print out what the list has in it.
Note that I'd like to just get some ideas of how to get the ball rolling with this method...I'm not a fan of just getting
the answer and pasting that into my program.
Is there any reason why it'd be bad to approach it like this? The reason it's named "unsorted" is because I'll have to do another method in which linked list is sorted...
You ought to print something like " ... -1 to exit."
You do not have a method there. You have a method which fills a list, and a method which prints it, and you are pretending both are the same method. You ought to have two methods.
Thanks for the replies - I"ll be posting another thread sometime regarding a different question I have. But this thread can be locked/ignored as it was a dumb thread anyway.
Don't get me started about those stupid light bulbs.