Edit question Given popular baby names by sex and ethnic group in 2011-2017. Data were collected through civil birth registration provided by DOHMH available owned by NYC OpenData. Write a Java program that sorting baby names in the descending order of frequency to represent the popularity of a name. Output the popular baby names by year of birth, gender and ethnic group requested by user. Input: Input file: “Popular_Baby_Names.csv”. Data Dictionary: Year of Birth: Year the baby was born Sex: Sex of the baby Ethnicity: Mother's Ethnicity Baby's First Name: Baby's first names Count: Number of babies with this name User is prompted to enter year of birth, gender, and ethnicity in console. Output: Output all the baby names by year of birth, gender, ethnic group requested by user in the order of popularity. For instance, Popular baby boy name in hispanic in 2017: Liam, Jacob, Dylan, Matthew, Noah, Sebastian, Jayden, Lucas, Ethan, Aaron, ………… Requirements: No third-party libraries are allowed. You may add Java code in the main method but do not modify the existed statements in HW4.java file. You may use BufferedReader, Scanner …… to read the input file. To parse a string, you may refer to the Java StringTokenizer class or String class. Classes required for the project: You may use a java built-in structure: ArrayList, LinkedList, Stack, HashMap or TreeMap or the data structures or algorithms we implemented in class to store or sort data. Attach all classes you implement and/or use. The main method must be in the HW4 class. You can download the Excel File here(Please copy paste it): ->>> https://data.cityofnewyork.us/Health/Popular-Baby-Names/25th-nujf Main.java import java.util.Scanner; public class Hw4 { public static void main(String[] args) { boolean done = false; while (!done) { System.out.print("Year of Birth(2011-2017, yyyy): "); Scanner in = new Scanner(System.in); int year = in.nextInt(); System.out.print("Gender(boy/girl): "); in = new Scanner(System.in); String gender = in.nextLine(); System.out.print("Ethnicity(asian/black/hispanic/white): "); in = new Scanner(System.in); String ethnicity = in.nextLine(); System.out.println("Popular baby " + gender +" names in " + ethnicity + " in " + year +":"); //add code to print out the popular baby names by year of birth, gender and ethnic group System.out.print("Interested in more(yes/no): "); in = new Scanner(System.in); String more = in.nextLine(); if (more.equalsIgnoreCase("no")) done = true; else done = false; } } }

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%
Edit question

Given popular baby names by sex and ethnic group in 2011-2017. Data were collected through civil birth registration provided by DOHMH available owned by NYC OpenData. Write a Java program that sorting baby names in the descending order of frequency to represent the popularity of a name. Output the popular baby names by year of birth, gender and ethnic group requested by user.

Input:

Input file: “Popular_Baby_Names.csv”.

Data Dictionary:

Year of Birth: Year the baby was born

Sex: Sex of the baby

Ethnicity: Mother's Ethnicity

Baby's First Name: Baby's first names

Count: Number of babies with this name

User is prompted to enter year of birth, gender, and ethnicity in console.

Output:

Output all the baby names by year of birth, gender, ethnic group requested by user in the order of popularity.

For instance,

Popular baby boy name in hispanic in 2017:

Liam, Jacob, Dylan, Matthew, Noah, Sebastian, Jayden, Lucas, Ethan, Aaron, …………

Requirements:

No third-party libraries are allowed.

You may add Java code in the main method but do not modify the existed statements in HW4.java file.

You may use BufferedReader, Scanner …… to read the input file. To parse a string, you may refer to the Java StringTokenizer class or String class.

Classes required for the project:

  1. You may use a java built-in structure: ArrayList, LinkedList, Stack, HashMap or TreeMap or the data structures or algorithms we implemented in class to store or sort data. Attach all classes you implement and/or use.
  2. The main method must be in the HW4 class.

You can download the Excel File here(Please copy paste it): ->>> https://data.cityofnewyork.us/Health/Popular-Baby-Names/25th-nujf

Main.java

import java.util.Scanner; public class Hw4 { public static void main(String[] args) { boolean done = false; while (!done) { System.out.print("Year of Birth(2011-2017, yyyy): "); Scanner in = new Scanner(System.in); int year = in.nextInt(); System.out.print("Gender(boy/girl): "); in = new Scanner(System.in); String gender = in.nextLine(); System.out.print("Ethnicity(asian/black/hispanic/white): "); in = new Scanner(System.in); String ethnicity = in.nextLine(); System.out.println("Popular baby " + gender +" names in " + ethnicity + " in " + year +":"); //add code to print out the popular baby names by year of birth, gender and ethnic group System.out.print("Interested in more(yes/no): "); in = new Scanner(System.in); String more = in.nextLine(); if (more.equalsIgnoreCase("no")) done = true; else done = false; } } }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Dictionary
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