Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Python Expert

Programming Project

Assignment Overview

The goal of this project is to gain more practice with functions, files, exception handling, and dictionaries.

Let's tackle a political question. It is standard political dogma that Democrats "want big government" and that Republicans "create jobs." Let's see if data supports the dogma. The official source of employment statistics is the U.S. Bureau of Labor Statistics (http://www.bls.gov/data/#employment) and we have collected data for private employment and government employment. Our assumption is that if a party is creating jobs, then private employment will increase, and if a party is creating bigger government, then government employment will increase. Your job is to extract that information from the files provided.

Project Specification

There are two employment data files provided. Both have comma-separated data. Look at the headings to understand their format. Numerical values are in thousands. The data for 2015 is, of course, incomplete.

• government_employment.txt
• private_employment.txt

There is also a comma-separated file on presidents, their years, and their political party.

• presidents.txt

Since the transition from one term to another occurs partway through January, the last year listed for any president is the same as the first year of the next president. To keep things simple let's count January entirely for the incoming president. That is, in the file the last year listed for a president will not count. For example, George W. Bush's last year is listed as 2009 but he was president for only a few weeks that year so we will not count him as being president in 2009. Also, watch out for the "Jr." for President Carter when you are reading the file-there is an extra comma. Finally, we will consider only the full years for each president so for Obama we will not count any data from 2015 (especially since the data for March and April is preliminary, not final data).

1. Your program will prompt for the file names. Use exceptions to check that each file was opened without an error.

2. All president data can only come from the presidents.txt file, i.e. you cannot code specifics about presidents into your program. We will test your program using a file of that format, but with different entries, for example we may test on a file that has three of the lines of that file.

3. As an academic requirement your program must define and use two functions in a meaningful way. (Feel free to use more functions; I did.)

4. Calculate and display in columns (see sample below):

1. the average monthly private employment for each political party

2. the average monthly government employment for each political party

3. the private employment of the first month and last month of each president

4. the change in private employment from the first month to the last month of each president; report the change as both a difference and as a percentage

5. the government employment of the first month and last month of each president

6. the change in government employment from the first month to the last month of each president; report the change as both a difference and as a percentage

5. Write a paragraph on your conclusions of the validity of the political dogma that "Democrats want big government and Republicans create jobs." Refer to your program output as evidence for your conclusion. Put the paragraph in a separate document (either as proj05.txt, proj05.tex or proj05.doc) and hand it in. Feel free to be creative.

6. Order to read files (added so we can preprocess your project).

a. Read president's file
b. Read private employment file
c. Read government employment file Deliverables

proj05.py and (proj05.txt, proj05.tex or proj05.doc) - your source code solution, and your paragraph.

1. Please be sure to use the specified file names, e.g. "proj05.py"

2. You will electronically submit a copy of the file using the "handin" program: http://www.cse.msu.edu/handin/webclient

Attachment:- Attachments.rar

Python, Programming

  • Category:- Python
  • Reference No.:- M91846618
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in Python

Questionwhat is a python development frameworkgive 3

Question What is a python development framework? Give 3 examples python development framework used today. and explain which development framework is used in which industry.

Tasksdemonstrate data scraping of a social network of

Tasks Demonstrate data scraping of a social network of choice. Develop technical documentation, including the development of the code & detailing the results. Provide a report on the findings, that includes research into ...

Question a software company sells a package that retails

Question : A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10 - 19 20% 20 - 49 30% 50 - 99 40% 100 or more 50% Write a program usi ...

Assignment1 utilising python 3 build the following

Assignment 1. Utilising Python 3 Build the following regression models: - Decision Tree - Gradient Boosted Tree - Linear regression 2. Select a dataset (other than the example dataset given in section 3) and apply the De ...

Python programming assignment -you first need an abstract

Python Programming Assignment - You first need an abstract base class, called, Account which has the following attributes and methods: accountID: This attribute holds the ID assigned the account , if not provided set to ...

Sieve of eratosthenes in pythonthe goal is to find all the

Sieve of Eratosthenes (in Python) The goal is to find all the prime numbers less than or equal to some natural number maxn. We have a list that tells us if any of the numbers 0..maxn are "marked". It can be an array of b ...

Question why is software configuration management

Question : Why is software configuration management considered an umbrella activity in software engineering? Please include examples and supporting discussion. The response must be typed, single spaced, must be in times ...

Below zero - ice cream storethe local ice-cream store needs

Below Zero - ice cream store The local ice-cream store needs a new ordering system to improve customer service by streamlining the ordering process. The manager of the store has found that many orders are incorrect and s ...

Architecture and system integrationcase study queensland

Architecture and System Integration Case Study: Queensland Health - eHealth Investment Strategy After evaluating various platforms, Queensland Health finally decided to adopt a Service Oriented Architecture (SOA) for its ...

A software company sells a package that retails for 99

A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10 - 19 20% 20 - 49 30% 50 - 99 40% 100 or more 50% Write a program using python t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As