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: Year 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 Rank1 Rank2 Jacob Jacob Jacob Rank3 Joshua Christopher Jacob Michael Matthew Jacob Michael Joshua Matthew Jacob Michael Joshua Matthew Jacob Michael Joshua Matthew Jacob Michael Joshua Matthew Jacob Michael Joshua Ethan Jacob Michael Ethan Joshua Michael Ethan Joshua Michael Alexander Ethan Ethan Michael Rank4 1 Jacob 21,875 2 Ethan 17,866 Rank5 Ethan Andrew Ethan Ethan Isabella Sophia Rank1 Emily Matthew Emily Daniel Emily Daniel Emma William Isabella Jayden William Isabella Madison Hannah Emily Emily Madison Hannah Emily Madison Emma Emma Madison Emily Emma Madison Emma Madison Isabella Isabella Emma Sophia Rank2 22,731 20,477 Rank3 static void topFiveNames() throws IOException { // add your code Emma Emily Olivia Emma The name ranking files for the year from 2001 to 2010 are babynamesranking2001.txt, babynamesranking2003.txt, babynamesranking 2004.txt, babynamesranking 2005.txt, babynamesranking2006.txt, babynamesranking 2007.txt, babynamesranking 2008.txt, babynamesranking2009.txt, babynamesranking2010.txt. Taking babynamesranking2010.txt a example, the format for each year name ranking file is as follows: Rank4 Ashley Emma Hannah Olivia Abigail Isabella Ava Olivia Sophia Olivia

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
2.
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:
Year
/**
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
Rank1
Jacob
Jacob
Jacob
Jacob
Jacob
Jacob
Jacob
Jacob
Jacob
Jacob
Rank2
Rank3
Michael Matthew
Joshua
Joshua
Michael
Michael
Michael
Joshua
Michael
Joshua
Michael
Joshua
Michael
Ethan
Michael
Ethan
Ethan Michael
Ethan Michael
1 Jacob 21,875
2 Ethan 17,866
Rank4
Joshua Christopher
Matthew
Matthew
Matthew
Matthew
Ethan
Joshua
Joshua
Alexande
Rank5
Ethan
Andrew
Ethan
Ethan
Isabella
Sophia
Matthew
Daniel
Daniel
Willia
Jayden William
Rank1
static void searchRanking() throws IOException {
// add your code
}
Emily Madison
Emily Madison
Emily
Emma
Emma
Emily
Emily
Emily
Emily
Emma
Isabell
Isabella
static void topFive Names() throws IOException {
// add your code
}
Rank2
22,731
20,477
Emma
Emma
Isabella
Isabella
Emma
Sophia
Rank3
Rank4
Hannah
Hannah
Madison
Madison
Madison Abigail
Madison
Isabella
Emma
Emily
Olivia
Emma
Ashley
Emma
The name ranking files for the year from 2001 to 2010 are babynamesranking2001.txt,
babynamesranking 2003.txt, babynamesranking 2004.txt, babynamesranking 2005.txt,
babynamesranking2006.txt, babynamesranking 2007.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:
Alexis
Alexis
Hannah
Olivia
Olivia Hannah
Olivia
Ava
Madison
Ava
Ava
Ava
Ava
Olivia
Sophia
Olivia
Rank5
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"
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
Transcribed Image Text:2. 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: Year /** 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 Rank1 Jacob Jacob Jacob Jacob Jacob Jacob Jacob Jacob Jacob Jacob Rank2 Rank3 Michael Matthew Joshua Joshua Michael Michael Michael Joshua Michael Joshua Michael Joshua Michael Ethan Michael Ethan Ethan Michael Ethan Michael 1 Jacob 21,875 2 Ethan 17,866 Rank4 Joshua Christopher Matthew Matthew Matthew Matthew Ethan Joshua Joshua Alexande Rank5 Ethan Andrew Ethan Ethan Isabella Sophia Matthew Daniel Daniel Willia Jayden William Rank1 static void searchRanking() throws IOException { // add your code } Emily Madison Emily Madison Emily Emma Emma Emily Emily Emily Emily Emma Isabell Isabella static void topFive Names() throws IOException { // add your code } Rank2 22,731 20,477 Emma Emma Isabella Isabella Emma Sophia Rank3 Rank4 Hannah Hannah Madison Madison Madison Abigail Madison Isabella Emma Emily Olivia Emma Ashley Emma The name ranking files for the year from 2001 to 2010 are babynamesranking2001.txt, babynamesranking 2003.txt, babynamesranking 2004.txt, babynamesranking 2005.txt, babynamesranking2006.txt, babynamesranking 2007.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: Alexis Alexis Hannah Olivia Olivia Hannah Olivia Ava Madison Ava Ava Ava Ava Olivia Sophia Olivia Rank5 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" 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
3.
q. quit
Select:
public static void main(String[] args) throws IOException {
// add your code
}
Test your program
Transcribed Image Text:3. q. quit Select: public static void main(String[] args) throws IOException { // add your code } Test your program
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education