Question
Name Popularity GUI From 2006 to 2010. Prompt user for name, gender and year. Use a ComboBox for gender and year. Use a TextBox for
Name Popularity GUI
From 2006 to 2010.
Prompt user for name, gender and year.
Use a ComboBox for gender and year.
Use a TextBox for the name
Use a button named Find Popularity
Application should read text from provided files, not be hardcoded.
If there is no ranking for the name/info entered, a message Sorry, no ranking for ..(babys name) in.(year) should be shown in results Textbox.
Sorry, I don't know how to add text files to the question but the files have lists that look like the below:
1 Jacob 21,036 Isabella 22,222
2 Ethan 19,783 Emma 17,830
3 Michael 18,822 Olivia 17,374
4 Alexander 18,175 Sophia 16,869
There are 5 files, each pertaining to a certain year from 2006 to 2010
Example output:
What I'm really having trouble with is accessing, sorting and then getting results from the text files.
Its very similar to the program below, except the program I need uses JComboBoxes and is in GUI format.
BookmarkBookmarked
(Baby name popularity ranking) The popularity ranking of baby names from year 2006 to 2015 can be downloaded from www.ssa.gov/oact/babynames and stored in files named babynamerank2006.txt, babynamerank2007.txt, babynamerank2015.txt. Each file contains 1000 lines. Each line contains a ranking, a boys name, number for the boys name, a girl name and number for the girls name. For example, the first two lines in the file babynameranking2010.txt are as follows: 1 Jacob 21,875 Isabella 22,731 2 Ethan 17,866 Sophia 20477 So the boys name Jacob and girls name Isabella are ranked #1 and the boys name Ethan and the girls name Sophia are ranked #2. 21875 boys are names Jacob and 22,731 girls are names Isabella in the year 2010. Write a program that enables the user to select a year, gender, and enter a name to display the ranking of the name for the selected year and gender, as shown in the following figure. Prompt the user to enter another inquiry or exit the program. To achieve the best efficiency, create two arrays for boys names and girls names, respectively. Each array has 10 elements for 10 years. Each element is a map that stores a name and its ranking in a pair with the name as the key. Here is a sample run.
Baby Name Popularity Select a Year 2010 Male Gender Enter a Name Ethan Find Ranking Ethan was #2 in 2010Step 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