• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting text file data to show in code.  RSS feed

 
Shaylen Patel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code so far,i have created a "birthdays.text" file with various peoples birthdays. How do I implement that into my code?
Thank your for any help.


 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shaylen Patel wrote:How do I implement that into my code?

Maybe somebody else will, but I have no idea what you mean by that.
I thought you might have meant you want to read the contents of the file, but you already appear to be doing that, so presumably you meant something else.
Can you try rephrasing your question ?
 
Shaylen Patel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i get the names/birthday in the text file, to print on the console
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shaylen Patel wrote:How do i get the names/birthday in the text file, to print on the console

Do you want to do this before you add them to the tree or do you want to traverse the tree after you've populated it ?
 
Shaylen Patel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Traverse the tree. So when 2 birthdays with the same day it will list all of them In order from Jan 1 to Dec 31
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what problems are you having ?
Assuming you've implemented your tree and iterator correctly, you just need to get an Iterator from the iteratorInOrder method, retrieve each element in turn and print out all the elements of each node.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!