Write a code that uses national data on relative frequency

Assignment Help Programming Languages
Reference no: EM131926721

Assignment

Write a code that uses National Data on the relative frequency of given names in the population of U.S. births, stored in a directory names, in files named yobxxxx.txt with xxxx(yob1931.txt and yob1880.txt) being the year of birth (here ranging from 1880 to 1949, but it is arbitrary and could be different).

The code prompts the user for a first name, and finds out the first year when this name was most popular in terms of frequency of names being given, as a female name and as a male name.

The code should include the names in the notepad files. The code should produce the expected outputs for the following test cases.

Test Case 1
Enter a first name: notgivenyet
In all years, notgivenyet was never given as a female name
In all years, notgivenyet was never given as a male name

Test Case 2
Enter a first name: Zed
In all years, Zed was never given as a female name
In terms of frequency, Zed was the most popular as a male name first in the year 1894.
It then accounted for 0.01% of all male names.

Test Case 3
Enter a first name: Zilpha
In terms of frequency, Zilpha was the most popular as a female name first in the year 1888.
It then accounted for 0.01% of all female names.
In all years, Zilpha was never given as a male name.

Test Case 4:
Enter a first name: John
In terms of frequency, John was the most popular as a female name first in the year 1880.
It then accounted for 0.05% of all female names.
In terms of frequency, John was the most popular as a male name first in the year 1880.
It then accounted for 8.74% of all male names.

Test Case 5:
Enter a first name: Charlotte
In terms of frequency, Charlotte was the most popular as a female name first in the year 2013.
It then accounted for 0.53% of all female names.
In terms of frequency, Charlotte was the most popular as a male name first in the year 1907.
It then accounted for 0.00% of all male names.

Test Case 6:
Enter a first name: Madison
In terms of frequency, Madison was the most popular as a female name first in the year 2001.
It then accounted for 1.23% of all female names.
In terms of frequency, Madison was the most popular as a male name first in the year 1881.
It then accounted for 0.03% of all male names.

Test Case 7:
Enter a first name: Peter
In terms of frequency, Peter was the most popular as a female name first in the year 1887.
It then accounted for 0.00% of all female names.
In terms of frequency, Peter was the most popular as a male name first in the year 1957.
It then accounted for 0.54% of all male names.

Attachment:- Text-Files.rar

Reference no: EM131926721

Questions Cloud

Which item should be carefully controlled : Which item(s) should be carefully controlled using a quantitative inventory technique, and what item(s) should not be closely controlled?
What is the intrinsic value of indigos stock : After that, the company will settle into a slower growth pattern and plans to pay dividends that will grow at a rate of 3.8% per year.
What are some other methods of evaluating a project : What are some other methods of evaluating whether to go forward or not with a project? Make a table with some rules!
How similar were enterococcus vancomycin resistance : How similar were Enterococcus's vancomycin resistance genes to those found in Staphylococcus aureus?
Write a code that uses national data on relative frequency : Write a code that uses National Data on the relative frequency of given names in the population of U.S. births, stored in a directory names.
How much must be in the account at the time they retire : They want to make quarterly deposits for 20 years so that they can then make quarterly withdrawals of $5,000 for 10 years.
How consistent is countertrade : How consistent is countertrade with the international trade framework? How do differences in corporate income tax rates across countries affect investment.
Identify two organs of the gastrointestinal tract : Part 1: Identify two organs of the gastrointestinal tract and discuss their structure and function in the digestive process.
Discuss reasons exist for rejecting a particular market : Many rational reasons exist for rejecting a particular market in the early stages of screening. Such decisions are made by humans, thus some irrational reasons

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd