GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes Popular Baby names help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Popular Baby names help" Watch "Popular Baby names help" New topic
Author

Popular Baby names help

Thomas Guan
Greenhorn

Joined: Feb 24, 2013
Posts: 1
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

Joined: Sep 20, 2010
Posts: 3647
    
  16

Hi Thomas, welcome to CodeRanch!

How familiar are you with Swing, or AWT? Did you have lectures regarding these technologies?
Manuel Petermann
Ranch Hand

Joined: Jul 19, 2011
Posts: 175

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?


Please correct my English.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7892
    
  21

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

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Manuel Petermann
Ranch Hand

Joined: Jul 19, 2011
Posts: 175

jfreechart might be better suited/easier for the job.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4474
    
    6

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 - [How to Ask Questions] [How to Answer Questions]
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4474
    
    6

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

Joined: Mar 17, 2011
Posts: 7892
    
  21

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
 
GeeCON Prague 2014
 
subject: Popular Baby names help