Skip to content

harris-ippp/03-salaries-turtles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homework 3: Salaries Revisited and Turtles

You can accept the assignment here.

In large measure, this week's homework rehashes your work with salaries in week 1. You'll answer the same questions, but use python to do so.

Even if you are familiar with it, please do not use pandas.

You will then create a few simple pictures, using methods of the "turtle" class.

The assignment is due Wednesday October 18th at 1:30am.

Salaries Revisited

Retrieving the data.

A copy of the salaries.csv files is included directly in your homework checkout, so that we'll all be working on the same copy.

Exercises!

You now have salaries.csv in your homework directory. The scripts q*py suggests formatting for stepping through these questions. Fill you answers in, there following the format exactly -- we'll check this with a computer. All of the "salaries" questions require the same pre-formatting. You should implement that formatting a single time with a function in helper.py, which you can import into the q*.py files. The individual question files will in turn just do some list comprehension, and set the solution variable.

Questions

Hint: you've done this before. You're answers had better match!

  1. Which salaried worker makes the most?
  2. How many employees does the city list?
  3. How many full-time workers are there in the file?
  4. How many part-time workers are there in the file? (Check you work for 1, with 2 and 3.)
  5. What is the highest hourly wage in the city?
  6. Excluding the top three workers (who are doctors), what is the highest hourly wage?
  7. How many people work for the police department?
  8. How many of them are detectives?
  9. How much does the median fireperson (employee of the fire department) make? (Note that in HW 1 this was modal.)
  10. What are the most common women's names for police officers (incl. detectives)? There are 37 occurrences.

Turtles - Bonus!

Turtles can recuperate lost points, but not get you above 100%.

Consult the documentation for the python turtle module:

https://docs.python.org/3.6/library/turtle.html

Using turtle and taking the pictures below as your model, fill in t*.py to create

  1. A pentagonal "tunnel"
  2. A checkerboard

I do not expect an exact match on the tunnel, but it should have 5 "sides" and spiral outwards.

The angle-dependent shading and rotating squares are "bonuses."

Push to GitHub

When you're all done, commit and push the code:

git add *py *ps # add the relevant files
git status # check that all your modified files are listed
git commit -m "phewff, all done!"
git push

Now go online to your GitHub page (with substitutions!), to check that everything is there:

You should have committed eleven salaries files (helper.py and q0.py to q9.py), plus any of the turtle files (t1.py and t2.py, and checkerboard.ps and pentagon_tunnel.ps).

Make sure it's in before Wednesday October 18th at 1:30am!

About

Homework 3: Salaries Revisited and Turtles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages