Write a java code for: Use the three attached files (babyNames2015.txt, babyNames2010.txt, and babyNames1880.txt) for your input data. Have the program handle a file not
Write a java code for:
Use the three attached files (babyNames2015.txt, babyNames2010.txt, and babyNames1880.txt) for your input data.
Have the program handle a file not found exception and output an error message to the user if either input file doesn't exist
Have the program prompt the user for the gender and first name. The prompt should explain to user what data the program expects.
Output the popularity of the name in 1880, 2010, and in 2015.
If the name isn't found in the top 1000, have the program output "not found" for that year
Calculate the increase or decrease in popularity from 1880 to 2010, from 1880 to 2015, and from 2010 to 2015, (assuming the name was in the top 1000 for those years).
Increase in popularity example #1: The male name "Noah" was ranked #130 in 1880, #7 in 2010, and #1 in 2015 for males. From 1880 to 2010, Noah increased in popularity by 123 (130-7). From 1880 to 2015, Noah increased in popularity by 129. From 2010 to 2015, Noah increased in popularity by 6.
Increase in popularity example #2: The female name "Harper" wasn't ranked in 1880, was #119 in 2010, and was ranked #10 in 2015. From 1880 to 2010, output "N/A" for the female name Harper (since this wasn't in the top 1000 for 1880). For 1880 to 2015, output "N/A" for the female name Harper (since this wasn't in the top 1000 for 1880). For 2010 to 2015, output 109 the female name Harper increased in popularity by 109 (from #119 to #10).
Text file "babyNames1880"
1 John Mary 2 William Anna 3 James Emma 4 Charles Elizabeth 5 George Minnie 6 Frank Margaret 7 Joseph Ida 8 Thomas Alice 9 Henry Bertha 10 Robert Sarah 11 Edward Annie 12 Harry Clara 13 Walter Ella 14 Arthur Florence 15 Fred Cora 16 Albert Martha 17 Samuel Laura 18 David Nellie 19 Louis Grace 20 Joe Carrie
Textfile "babyNames2010"
1 Jacob Isabella 2 Ethan Sophia 3 Michael Emma 4 Jayden Olivia 5 William Ava 6 Alexander Emily 7 Noah Abigail 8 Daniel Madison 9 Aiden Chloe 10 Anthony Mia 11 Joshua Addison 12 Mason Elizabeth 13 Christopher Ella 14 Andrew Natalie 15 David Samantha 16 Matthew Alexis 17 Logan Lily 18 Elijah Grace 19 James Hailey 20 Joseph Alyssa
Textfile" babyNames2015"
1 Noah Emma 2 Liam Olivia 3 Mason Sophia 4 Jacob Ava 5 William Isabella 6 Ethan Mia 7 James Abigail 8 Alexander Emily 9 Michael Charlotte 10 Benjamin Harper 11 Elijah Madison 12 Daniel Amelia 13 Aiden Elizabeth 14 Logan Sofia 15 Matthew Evelyn 16 Lucas Avery 17 Jackson Chloe 18 David Ella 19 Oliver Grace 20 Jayden Victoria
//Please Note that "this is not the complete list of the names in each year "I provided the top 20th names in each year since each text file is way too long.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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