Population and land area data for hundreds of countries

Assignment Help Business Economics
Reference no: EM131427077

Objectives:

  • specifically work with files, strings, lists, counters, and accumulators

Instructions:

write a program that reads data from a file and shows a report to the user in python.

Program Specification

Here is a link to a data file:

WorldData2012.txt

that contains population and land area data for hundreds of countries (and other geo-political units) adapted from this web site (Links to an external site.).  Each line in the file contains the name of a country, the population, and the land area, in that order.  Your job is to write a program that analyzes this data in various ways and shows a report to the user.  Here is what the program output should include:

  • the total number of countries in the list
  • the total world population
  • the name and population of the country that has the highest population
  • the name and population of the country that has the lowest population
  • the name and land area of the country that has the greatest land area
  • the name and land area of the country that has the smallest land area
  • the name and population density of the country that has the highest population density
  • the name and population density of the country that has the lowest population density
  • average population density (the average of the population densities of all the countries, not the population density of the planet as a whole)
  • a list of "densely populated countries" (those with a population density that is more than two times the average)
  • a list of "verysparsely populated countries" (those with a population density that is less than 1% of the average)

Note: land area is given is square kilometers (sq. km.), and "population density" is defined as "population per square kilometer."

Development Tips:

  1. Plan your program carefully on paper before you start writing code.  You may find the sample program illustrating the 'split' method to be a useful reference.
  2. How can you convince yourself that your program is producing correct results with such a large data file?  Consider creating a shorter file with the same format for initial testing purposes so that you can verify calculated results by hand.
  3. Here's one way to accomplish the last two tasks: 
  • The first time you read through the file, include an accumulator that allows you to determine the average of the population densities of all the countries.  Just calculate the population density for each country as you go, and then use the normal "find the average" pattern to determine the average value.
  • Read through the file a second time and use "sifting" operations to fill in the two lists.

Reference no: EM131427077

Questions Cloud

Multimedia system development course : Topic: Discuss the compression and its major types, and the techniques used in each type. Explain which type is best for compressing the digital media files.
What is the optimal call policy of the issuing firm : What is the optimal call policy of the issuing firm, assuming that the firm is trying to maximize shareholder wealth? What is the value of the callable bond?
How a system could improve efficiency : As the new manager of a convenience store, you have noticed issues with the manual method of tracking sales using paper sales tickets and spreadsheets, as well as, shortages on some of the more popular items carried in the store.
What is the null hypothesis for your question : What is your research question? What is the null hypothesis for your question? What research design would align with this question?What dependent variable was used and how is it measured?What independent variable is used and how is it mea..
Population and land area data for hundreds of countries : Each line in the file contains the name of a country, the population, and the land area, in that order.  Your job is to write a program that analyzes this data in various ways and shows a report to the user.  Here is what the program output should..
Standard out of the box solution : The company has taken the approach to use the standard out-of-the-box solution and has decided to not customize it. As a part of the implementation they decide to go with Oracle as a part of their IT infrastructure and will be utilized as it's:
Create your nab company name and explain its significance : The name for my non-alcoholic beverage company is called "Splash". With Splash we intend to bring another fruit drink to the market using all natural fruit flavors. By using natural flavors we can also cut down on the sugar that's used which mak..
Which analytical tools are particularly useful : Which of following analytical tools are particularly useful for determining whether a company's prices and costs are competitive? SWOT analysis, strategy assessment, activity-based costing analysis, and key success factor analysis.
Scrum model of software development : Write a 2-page essay that compares and contrasts the Scrum Model of software development with the Unified Process model. Give a brief overview of both models and if there are multiple views of a model, make sure you indicate your source if the vie..

Reviews

Write a Review

Business Economics Questions & Answers

  Accommodate new payer and consumer expectations

The traditional management style of hospitals has been hierarchical and internally focused. What are three important challenges that face hospitals to accommodate new payer and consumer expectations?

  What are the relevant facts and figures about this company

What are the relevant facts and figures about this company? For example, where is its headquarters? How many hotels/rooms are owned or identified with that company?

  Explain the firm position to shareholders

Is there a conflict between maximizing shareholder wealth and never paying bribes when doing business abroad? If so, how might you explain the firm's position to shareholders asking why the company does not pay bribes when its foreign competitors in ..

  Effectiveness from a business perspective

Fiscal policies is a tool used by government to stimulate the economy. This week we will consider monetary policies - these are policies implemented by Fed to support sustainable growth, support high employment and keep prices stable in the US econom..

  At what price would you receive a margin call

The current market price for XYZ is $52 per share. Initial margin is 50%, maintenance margin is 35% and margin interest is 1.75% per year. You believe the stock price will increase over the next year and wish to trade exactly one round lot. What trad..

  Concept of nesting functions in excel

In your own words, explain the concept of nesting functions in Excel? Why is it useful? Give at least one example.

  Inflationary pressure is growing problem for the economy

Inflationary pressure is a growing problem for the economy. Therefore, the Federal Reserve decides to pursue a policy to reduce the inflationary pressure. Which policy changes by the Fed would reinforce each other to achieve that objective?

  What is the wage quantity hired wage plus employer taxes

what is the wage, quantity hired, wage plus employer taxes and wage minus employee taxes if employees pay a $6 tax?

  Shows little substitution between two factor inputs

Draw in excel an isoquant that shows little substitution between two factor inputs and on that shows large substitution. Vertical represents capital and horizontal represents labor

  Find their critiques compelling

With regard to consumerism, immigration, and nutrition, where do you find their critiques compelling.

  Cause a shift in demand for coca-cola

Which of the following would NOT cause a shift in demand for Coca-Cola:

  Obedience to authority can be powerful social pressure

Obedience to authority can be a powerful social pressure to conform and comply with a request that might be against our intuitive sense of right and wrong. Milgram's study of obedience has contributed to understanding how people can commit in human a..

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