Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
storing a file data in an array Posted by dino1992 on 27 Jun 2012 at 5:15 AM
my program discription is below i need to know how to store the rank, names in ana array either single array or 2d array .. anyone has an idea how to do it ?

please i need the help asap !! thank u

The text files USPopularNames2010.txt, contains a list of the 1,000 most popular boy and girl names in the United States for the year 2010 as compiled by the Social Security Administration.

These are blank-delimited files where the most popular boys and girls name is listed first, the second most popular boys and girls name is listed second, and so on, to the 1,000th most popular boys and girls name, which is listed last. Here is an example of one line: of the input file

30 Liam Sarah

This indicates that the 30th popular name for boys is Liam and for girls is Sarah
Note the first line of the file contains a description of the data, so you really want to skip reading the first line of the input file.


What you need to do:
• Write a program that will read the data from the files and store them into a either single or 2D arrays.
• If the file do not exist then display a message to the screen indicating the specific file name does not exist and
• update file errorLog.txt by appending the file name that caused the error, then terminate the program. The file errorLog.txt will contain the list of all the file names, each on a separate line, that this program had problems opening them for reading.
• On the other hand, if the file does exist then proceed to reading it into arrays then
o prompt the user to input a name .
o The program should search through the array(s).
 If there is a match, then it should output the popularity ranking and whether it is a girl or boy name.
 The program should also indicate if there is no match.
• The program should then prompt the user if they which to search for another name or end the program.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.