assignments
due Tue Sep 6
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 13
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 20
three: strings
- Read chapter 4 in the text.
- In chapter 4, do exercises 8 and 9 (on the 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 about any of this stuff.
due Tue Sep 27
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.
- Are we having fun yet?
due Tue Oct 4
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 11
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 : Problem 9 from http://projecteuler.net: Find a,b,c such that a**2+b**2==c**2 and a+b+c=1000.
- A graded mini-project is due on Oct 25. (Oct 18 is Hendrick's vacation.) 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 18
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 25
mid-term projects
- ... can be turned in here.
due Tue Nov 1
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 8
eight: more classes and data collections
- Read chapter 11
- Do exercises 14 and 15 from chapter 11 in the following way, building on our discussion in class Thu Nov 3
- The overall task is to create the objects (classes) for Card, Hand, PokerHand, and Deck, and uses these classes to create two poker hands and say which one wins. Your main() program should be the only part that has any "print" statements, and should be short.
- Write the main() program *first*, deciding which methods you will need in which classes.
- Set up the args and return values for the classes and methods *without* having them do more than return the appropriate sort of value.
- Once everything is set up, then finish implementing and testing the methods.
due Tue Nov 15
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 22
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 29
thanksgiving
- submit as much as you have for your final project (outline, rough draft, start of top-down thinking, ...)
- catch up on any outstanding homework
due Tue Dec 6
project presentations
- Come to class ready to present your final project.
due Fri Dec 9
final project
- Turn in all final project materials (code, docs, paper describing what you did).
term grade
- a place for Jim to record your overall grade