Write a program that reads the files contents into a list

Assignment Help Programming Languages
Reference no: EM131270503

Programming Assignment

Overview

This assignment will give you more experience on the use of lists and files.

Part 1: Name Search

Write a program that reads the contents of the following two files into two separate lists.

- GirlNames.txt - This file contains a list of the 200 most popular names given to girls born in the United States from the year 2000 through 2009.

- BoyNames.txt - This file contains a list of the 200 most popular names given to boys born in the United States from the year 2000 through 2009.

The user should be able to enter a boy's name, a girl's name, or both, and the application will display messages indicating whether the names were among the most popular.

Here is a sample run of the program:

Enter a boy's name, or N if you do not wish to enter a boy's name: Jacob
Enter a girl's name, or N if you do not wish to enter a girl's name: Amal
Jacob is one of the most popular boy's names.
Amal is not one of the most popular boy's names.

Part 2: Population Data

The file USPopulation.txt contains the midyear population of the United States, in thousands, during the years 1950 through 1990. The first line in the file contains the population for 1950, the second line contains the population for 1951, and so forth.

Write a program that reads the file's contents into a list. The program should display the following data:

- The average annual change in population during the time period
- The year with the greatest increase in population during the time period
- The year with the smallest increase in population during the time period

Here is a sample run of the program:

The average annual change in population during the time period is 2,443.88

The year with the greatest increase in population was 1955

The year with the smallest increase in population was 1967

Reference no: EM131270503

Questions Cloud

Waste generation from produced water : Discuss specific process-activity that generates the waste and quantity of waste generated (worldwide and in the UAE/Abu Dhabi)
Why it is appropriate to provide the theoretical foundation : Why it is appropriate to provide the theoretical foundation for your problem statement?- How does a theoretical foundation specifically link to the problem statement for the study?
What is the reason for this difference : The perfectly competitive firm exhibits resource allocative efficiency (P=MC), but the single-price monopolist does not. What is the reason for this difference?
What are the treatments for reducing high cholesterol : Do the benefits of lowering cholesterol outweigh the risks of taking medication? What options exist for a person to try and reduce his/her cholesterol without taking medication? How would you alleviate any fears Mr. Brown may have regarding his condi..
Write a program that reads the files contents into a list : Write a program that reads the file's contents into a list. The program should display the following data: The average annual change in population during the time period.
Advance or impede theories or models : How do the results of research studies advance or impede theories or models?- How do you expect that the results of your dissertation study may advance knowledge of this theory or model? Explain.
What are the variable costs of producing too units : a. What are the variable costs of producing too units. b. Write out the total cost equation assuming variable costs are linear. c. What is the marginal cost of the 50th unit of output? d. What is the average total cost of the 50th unit of output?
Competitive firm output of a tax : Compare the effect upon a competitive firm's output of a tax of $1 per unit upon output versus a license fee of $200 payable each year regardless of output. Please Clarify.
Journal entries for the cash transactions : Costs that do not change with level of activity and Fixed up to a certain level of activity, rise and stays fixed again until another level - Journal entries for the Cash transactions

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