Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Popular Baby names help

 
Thomas Guan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone my name is Thomas and I'm new to this website. Anyways I'm a beginning programmer and I am completely stumped on this next assignment. It graphs the popularity of baby names from 1880 to 2010.

The directions are pretty long so here they are http://www.cs.washington.edu/education/courses/cse142/13wi/handouts/14.html

The program basically asks us to give an introduction, ask the user for a name and gender combination and then then it will read the data file. If it finds it it should graph the data. If it doesn't find it there will be a short message saying it is not found. Also if the combination is found there should be a DrawPanel graph for the data.

Thanks in advanced!
 
Stephan van Hulst
Bartender
Posts: 6321
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thomas, welcome to CodeRanch!

How familiar are you with Swing, or AWT? Did you have lectures regarding these technologies?
 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either i am way to tired right now or there really is no question there.

Due to tuesday might be a stretch if you haven't started yet and don't know anything about swing.
Are you allowed to use third party libraries? What have you done yet? What exactly is your problem?
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thomas Guan wrote:The program basically asks us to give an introduction, ask the user for a name and gender combination and then then it will read the data file. If it finds it it should graph the data. If it doesn't find it there will be a short message saying it is not found. Also if the combination is found there should be a DrawPanel graph for the data.

Well, like Manuel, I'm not sure what your question is.

I'm also no GUI expert, so I can't advise on how to display your graph beyond looking at something like JGraph; but I can tell you that there are two components to your problem, and you should try to keep them as separate as possible:
1. Translating the file data to a Java Object (GraphData?), most likely in java.util.Map form.
2. Retrieving entries of that object based on user input and plotting them.

Winston
 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jfreechart might be better suited/easier for the job.
 
Junilu Lacar
Bartender
Pie
Posts: 7758
61
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The assignment states that they are supposed to use a class that's being provided: DrawingPanel.java

I think that class is all the OP needs to draw the graph.
 
Junilu Lacar
Bartender
Pie
Posts: 7758
61
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
1. Translating the file data to a Java Object (GraphData?), most likely in java.util.Map form.


The instructions also specifically state how the input should be processed, and it's not supposed to be with a Map. I don't want to get into the "slavishly following" discussion again, so OP should be advised to ask instructor how much they are allowed to deviate from the letter of the instructions.
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:The instructions also specifically state how the input should be processed, and it's not supposed to be with a Map. I don't want to get into the "slavishly following" discussion again, so OP should be advised to ask instructor how much they are allowed to deviate from the letter of the instructions.

Agreed. I'd only say that if the DrawingPanel is not to be translating directly from String data, then you will, at the very least, need something that converts a line from the file to a bunch of numbers; and I reckon that should be held in an object.

Overspecification again?

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic