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

  Economics assignment

This document contains various important questions and their appropriate answers in the subject field of Economics.

  Demand and supply curves

Economics is the study of the principles governing the allocation of scarce means among competing ends when the objective of the allocation is to maximize the attainment of the ends.

  Long-run perfectly competitive equilibrium for the firm

Evaluate Government intervene and correct this situation?(a) Explain the concept of a concentration ratio. A rise in the price of magarine Explain the impact of external costs and external benefits on resource allocation long-run perfectly c..

  Supply and demand diagrams

Explain each of the following using supply and demand diagrams,  With the use of a graph, explain how these two programs affect cigarette consumption and the price of cigarettes.

  Case study: fisher-price toys

The case study of the Fisher-Price Toys, Inc., a popular case in basic economics and management from the prestigious Harvard Business School.

  Draw the production possibility curve

Draw the production possibility curve and a. Define consumer surplus and producer surplus.

  Tax revenue

The Australian government administers two programs that affect the market for cigarettes

  Maximize total welfare

How many tickets to sell to maximize total welfare.

  Difference between the cv and the ev

The change in consumer surplus (?CS) is not "theoretically" justifiable like the CV and EV but it continues to be the most widely used measure of consumer welfare change. Explain how this can be reconciled

  Depict von neumann-morgenstern utility index u in a diagram

Depict the von Neumann-Morgenstern utility index u in a diagram

  What is the market solution

What is the market solution (market price and quantity) and What is the total surplus of the society under the market solution

  Calculate gross national product and net national product

Calculate gross national product and net national product

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