Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write new code for the following program: (Each txt. document will have rankings of names) babynamesranking2001.txt babynamesranking2002.txt babynamesranking2003.txt babynamesranking2004.txt babynamesranking2005.txt babynamesranking2006.txt babynamesranking2007.txt babynamesranking2008.txt babynamesranking2009.txt
Please write new code for the following program:
(Each txt. document will have rankings of names)
babynamesranking2001.txt babynamesranking2002.txt babynamesranking2003.txt babynamesranking2004.txt babynamesranking2005.txt babynamesranking2006.txt babynamesranking2007.txt babynamesranking2008.txt babynamesranking2009.txt babynamesranking2010.txt
Create a project in NetBeans and name the project Hw05. Write a program with the following methods: (1) / topFive Name() method reads the top five ranking boy and girl's names from the babynamesranking files for the year from 2001 to 2010 and save them in a file called topFiveBabyNames.txt in the following format: The name ranking files for the year from 2001 to 2010 are babynamesranking2001.txt, babynamesranking2003.txt, babynamesranking2004.txt, babynamesranking2005.txt, babynamesranking2006.txt, babynamesranking2007.txt, babynamesranking2008.txt, babynamesranking2009.txt, babynamesranking2010.txt. Taking babynamesranking 2010.txt as an example, the format for each year name ranking file is as follows: / static void topFiveNames() throws IOException \{ // add your code \} (2) / searchRanking() method asks the user for a name and a year between 2001 and 2010 to search the name's ranking in the year user entered. Assume the user enters Jacob and 2010 , the method prints a message "The name Jacob is ranked \#1 in the year 2010 ". If the user enters ABC and 2010 , the method prints "The name ABC is not ranked" / static void searchRanking ( throws IOException \{ // add your code \} (3) / main() method creates a menu and processes the user's choices. The menu looks like: a. Generate a file containing top five names b. Search a name ranking in a specific year q. quit Select: */ public static void main(String[] args) throws IOException \{ // add your code \} 3. Test your programStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started