• Post Reply Bookmark Topic Watch Topic
  • New Topic

tracing genealogies  RSS feed

 
Enos Winder
Greenhorn
Posts: 18
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I am once again trying to get this piece of code to spit out information.



ok, the problem is it doesn't spit anything out and I am not sure why. Any help would be greatly appreciated
 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any point in your main method that would produce output, other than at Line 236 (where it should print "Enter the filename:" on the console; does it do that much, at least?). After that, it looks like you just read the file, then exit the program.

Also, please don't use capital letters as the first letter of your variable names (Line 229). Do that for class names, instead.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my guess (and I looked at your 200+ lines of code for about 10 seconds) is that you need to flesh out this part a little more:

 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enos Winder wrote:Ok, I am once again trying to get this piece of code to spit out information.

Once again? Did you include it in another topic somewhere? If so, I can't see it...

Also: In addition to dealing with genealogy, you seem to be rolling your own linked list. Were you asked to do this? Because Java already has a perfectly good one - called, oddly enough, LinkedList (←click).

My advice: Do one thing at a time.

And just one stylistic point: You seem very fond of do...while loops, which are actually quite rare in the real world because:
a. The reader has to skip to the bottom to work out when the loop exits.
b. They can almost always be rewritten as either a while loop (where the exit strategy is at the top), or a more self-contained for loop.

However, there's no 'right' or 'wrong' about this - indeed, I sometimes use them myself to highlight to my reader that the loop is always executed once. But if I do, I rarely put more than two or three lines in the "body", even if it means writing an extra method.

HIH

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!