Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
11th Edition
ISBN: 9780134671710
Author: Y. Daniel Liang
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 12, Problem 12.31PE

(Baby name popularity ranking) The popularity ranking of baby names from years 2001 to 2010 is downloaded from www.ssa.gov/oact/babynames and stored in files named babynameranking2001.txt. babynameranking2002.txt, … , babynameranking2010.txt. You can download these files using the URL such as http://liveexample.pearsoncmg.com/data/babynamesranking2001.txt. Each file contains 1,000 lines. Each line contains a ranking, a boy’s name, number for the boy’s name, a girl’s name, and number for the girl’s 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    20,477

Therefore, the boy’s name Jacob and girl’s name Isabella are ranked #1 and the boy’s name Ethan and girl’s name Sophia are ranked #2; 21,875 boys are named Jacob, and 22,731 girls are named Isabella. Write a program that prompts the user to enter the year, gender, followed by a name, and displays the ranking of the name for the year. Here is a sample run:

Enter the year: 2010 Chapter 12, Problem 12.31PE, (Baby name popularity ranking) The popularity ranking of baby names from years 2001 to 2010 is , example  1

Enter the gender: M Chapter 12, Problem 12.31PE, (Baby name popularity ranking) The popularity ranking of baby names from years 2001 to 2010 is , example  2

Enter the name: Javier Chapter 12, Problem 12.31PE, (Baby name popularity ranking) The popularity ranking of baby names from years 2001 to 2010 is , example  3

Javier is ranked #190 in year 2010

Enter the year: 2010 Chapter 12, Problem 12.31PE, (Baby name popularity ranking) The popularity ranking of baby names from years 2001 to 2010 is , example  4

Enter the gender: F Chapter 12, Problem 12.31PE, (Baby name popularity ranking) The popularity ranking of baby names from years 2001 to 2010 is , example  5

Enter the name: ABC Chapter 12, Problem 12.31PE, (Baby name popularity ranking) The popularity ranking of baby names from years 2001 to 2010 is , example  6

The name ABC is not ranked in year 2010\

Blurred answer
Students have asked these similar questions
Python Program:
HMM Viterbi MLS Calcucation Write a program named hmm_viterbi that takes two command-line arguments: a model file name and a text file name that contains a single untagged sentence. This program should load the given model, then use the viterbi algorithm to find the most likely POS tag sequence for the given sentence.
javascript please //20. function initPage//a. Dependencies: getUsers, populateSelectMenu//b. Should be an async function//c. No parameters.//d. Call await getUsers//e. Result is the users JSON data//f. Passes the users JSON data to the populateSelectMenu function//g. Result is the select element returned from populateSelectMenu//h. Return an array with users JSON data from getUsers and the select element//result from populateSelectMenu: [users, select] html <body>    <header>        <h1>Acme Blogs</h1>        <form id="filterForm">            <select id="selectMenu">                <option selected>Employees</option>            </select>        </form>    </header>    <main>        <p class="default-text">Select an Employee to display their posts.</p>    </main>    <footer>        <p>Acme Company</p>    </footer>    <div id="mocha" class="testResults"></div>…

Chapter 12 Solutions

Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)

Ch. 12.4 - Prob. 12.4.3CPCh. 12.4 - Prob. 12.4.4CPCh. 12.4 - Prob. 12.4.5CPCh. 12.4 - Prob. 12.4.6CPCh. 12.4 - What is displayed when running the following...Ch. 12.4 - Prob. 12.4.8CPCh. 12.4 - What does the method getMessage() do?Ch. 12.4 - What does the method printStackTrace() do?Ch. 12.4 - Prob. 12.4.11CPCh. 12.4 - Prob. 12.4.12CPCh. 12.5 - Prob. 12.5.1CPCh. 12.6 - Prob. 12.6.1CPCh. 12.7 - Prob. 12.7.1CPCh. 12.8 - Prob. 12.8.1CPCh. 12.9 - Prob. 12.9.1CPCh. 12.9 - Prob. 12.9.2CPCh. 12.10 - What is wrong about creating a File object using...Ch. 12.10 - How do you check whether a file already exists?...Ch. 12.10 - Can you use the File class for I/O? Does creating...Ch. 12.11 - Prob. 12.11.1CPCh. 12.11 - Prob. 12.11.2CPCh. 12.11 - Prob. 12.11.3CPCh. 12.11 - Prob. 12.11.4CPCh. 12.11 - What will happen if you attempt to create a...Ch. 12.11 - Prob. 12.11.6CPCh. 12.11 - Suppose you enter 45 57, 8 789, then press the...Ch. 12.11 - Prob. 12.11.8CPCh. 12.12 - How do you create a Scanner object for reading...Ch. 12.13 - Prob. 12.13.1CPCh. 12.13 - Simplify the code in lines 20-28 as follows: 1....Ch. 12 - Prob. 12.1PECh. 12 - (InputMismatchException) Write a program that...Ch. 12 - (ArrayIndexOutOfBoundsException) Write a program...Ch. 12 - (IllegalArgumentException) Modify the Loan class...Ch. 12 - (IllegalTriangleException) Programming Exercise...Ch. 12 - (NumberFormatException) Listing 6.8 implements the...Ch. 12 - Prob. 12.7PECh. 12 - Prob. 12.8PECh. 12 - Prob. 12.9PECh. 12 - Prob. 12.10PECh. 12 - Prob. 12.11PECh. 12 - (Reformat Java source code) Write a program that...Ch. 12 - (Count characters, words, and lines in a file)...Ch. 12 - (Process scores in a text file) Suppose a text...Ch. 12 - (Write/read data) Write a program to create a file...Ch. 12 - Prob. 12.16PECh. 12 - (Game: hangman) Rewrite Programming Exercise 7.35....Ch. 12 - Prob. 12.18PECh. 12 - (Count words) Write a program that counts the...Ch. 12 - Prob. 12.20PECh. 12 - (Data sorted?) Write a program that reads the...Ch. 12 - Prob. 12.22PECh. 12 - (Process scores in a text file on the Web) Suppose...Ch. 12 - (Create large dataset) Create a data file with...Ch. 12 - (Create a directory) Write a program that prompts...Ch. 12 - Prob. 12.26PECh. 12 - (Replace words) Suppose you have a lot of files in...Ch. 12 - (Rename files) Suppose you have a lot of files in...Ch. 12 - (Rename files) Suppose you have several files in a...Ch. 12 - (Occurrences of each letter) Write a program that...Ch. 12 - (Baby name popularity ranking) The popularity...Ch. 12 - (Ranking summary) Write a program that uses the...
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Files & File Systems: Crash Course Computer Science #20; Author: CrashCourse;https://www.youtube.com/watch?v=KN8YgJnShPM;License: Standard YouTube License, CC-BY
UNIX Programming (Part - 10) The File System (Directories and Files Names); Author: ITUTEES;https://www.youtube.com/watch?v=K35faWBhzrw;License: Standard Youtube License