assignments
due Tue Sep 7
one: Preliminaries
- Start reading chapter 1 in the text.
- Start getting your software tools in order :
- Install (if need be) python on your computer, if that's where you'll work.
- Install (if need be) a text editor (not a word processor)
- If you can, do exercise 1 ('A' through 'L') on page 22 of the text.
- On the course page where you submit this week's work, tell me
- what your computer background is, and
- how all the work described above is going.
due Tue Sep 14
two: input, output, numbers, and loops
- Read chapters 2 and 3 in the text.
- Do and submit exercises 1, 7, 10 on page 49 & 50, at the end of chapter 2.
- Do and submit exercises 12, 14, and 16 on page 74, at the end of chapter 3.
- Comments? Questions?
due Tue Sep 21
three: strings
- Read chapter 4 in the text.
- Do exercises, 8 and 9 (Caeser cipher), 13 (formatted numbers), and 15 (read and summarize a file) on pages 120 and 121.
- Please do find me or email me if you have questions.
due Tue Sep 28
four: graphics and objects
- Read chapter 5
- Do exercise 3 (draw a face) on page 160.
- Do exercise 12 (bar chart from file data) on page 162.
- Describe briefly the following terms with examples from your code:
- class
- instance
- method
- argument
- Write either a program that does some sort of graphics animation (e.g. makes something change over time as I did with "from time import sleep" and "import random") or that responds to mouse clicks, or both (the latest graphics.py has a win.checkMouse() that gives the last click, without waiting). All the details are left up to you; choose something that suits your background and skills. (Warning: I have occasionally seen win.getMouse() give screen rather than window coords. Put in debugging print statements if you need to. Calling win.setCoords() early may help.)
due Tue Oct 5
five: functions
- Read chapter 6
- Describe briefly the following notions, and give a code example.
- return value
- local variable
- global variable
- argument
- Do exercise 2 (the ants) on page 194.
- Do exercises 11 through 14 (which go together) on page 196.
- Re-write any one program from previous assignment using functions to make it cleaner and shorter.
due Tue Oct 12
six: conditionals
- Read chapters 7 and 8. (This is a lot; feel free to skim bits of it and come back to those parts later.)
- Page 250 in the text describes "De Morgan's Laws". Write a python program that loops over all possible True/False values for A and B and shows explicitly that those "laws" are correct. (I did a similar loop in class on Tues Oct 7.)
- Do exercise 7 from chapter 7 on page 229.
- Do exercises 11 and 12 from chapter 8 on page 263.
- Optional : Find the sum of all the positive integers less than a thousand that are multiples of 3 or 5. (This is problem 1 from projecteuler.net .)
- A graded mini-project is due on Oct 28. (Oct 21 is Hendrick's) I'd like you to propose something that uses the loops, conditionals, and file i/o we've been working on. It could do some sort of analysis or transformation of a file, or play a simple text oriented game, or use the graphics library. All I'm asking now is that you choose something so I can give you feedback as to how feasable that sounds.
due Tue Oct 19
catchup
- Hendrick's Days -- no work due today.
- Continue work on your midterm project. (Optional progress report here would be fine.)
- Or catchup with any missed work.
due Tue Oct 26
midterm project
- Complete the project that you proposed last week.
- Include the following documentation:
- header at top of each file
- docstring for each function
- implementation comments for tricky stuff
- description of how to run it
- examples of what happens when you run it
- Essentially I should be able to easily tell what it is, how to use it, and what's going on inside. Part of your grade will be inversely proportional to how much effort I need to understand what you did.
- Convince me that it does what you think it does. (The easiest way to do this is with tests, but enough examples can serve the same purpose.)
- Questions? Ask.
due Tue Nov 2
seven: defining classes
- Read chapter 10
- Do the "playing card" exercise, chapter 10 exercise 11 on page 333-334.
- Modify any program you've written previously this semester to include a class definition.
- Optional: do chapter 10 exercise 12, which adds graphics to the card hands.
due Tue Nov 9
eight: data collections
- Read chapter 11
- Do any two of the following programming exercises:
- Problem 6 on page 379, shuffling a list.
- Problem 10 on page 380, the sieve of erathosnes.
- Problem 12 on page 380, the "automated censor".
- Problem 14 on page 380, recognizing poker hands.
due Tue Nov 16
nine : object oriented design
- Read chapter 12
- Propose and start working on a final project. This may be a continuation of your midterm project, if there are additional features you'd like to add or re-write. As described in class this should be:
- Similar in effort to the midterm project, but with a bit more "oomph" now that your skills are growing.
- Again, clearly documented, and either tested or clearly demonstrated.
- Again, be clear what is your own new work, and what is work you or others have done previously.
- In your own words, describe the terms "encapsulation", "polymorphism", and "inheritance" as used by object oriented programmers.
- The textbook's "text video poker" example has no doc strings or tests. I'd like you put both in. More specifically:
- From the book code for chapter 12 directory, grab the files dice.py, pokerapp.py, and textpoker.py .
- Figure out how this code works by reading through the three files and running the program.
- Add doc strings and tests for the methods, and submit your versions of those three files. (Don't forget to change the comment at the top to include your name and a reference to the original source.)
- Do any one of the programming exercises 4 through 8 from chapter 12. (ATM machine, dice game, bridge opening bid, card game, or board game.) You may use classes from the text examples, Jim's examples, or your own work; if so, make it clear what's your work, and credit your sources.
due Tue Nov 23
ten : algorithms and recursion
- Read chapter 13, the last in our text.
- Do any two problems from this list: [3, 4, 5, 6, 8] on pages 463 and following.
due Tue Nov 30
thanksgiving break
- Give me a brief progress update on your final project.
- Catch up any outstanding previous work.
due Tue Dec 7
project presentations
- Come to the last class prepared to show your final project and discuss with the class
due Fri Dec 10
final project
- Turn in all final project materials (code, docs, paper describing what you did).
term grade
- a place for Jim to record the overall term grade