assignments
due Tue Sep 4
Preliminaries
- Read chapter 1 in the text.
- Start getting your software tools in order :
- Install python on your computer, if it doesn't already have it, and if that's where you'll be doing your work. See python.org's download page for versions that match various operating systems. On a Mac, you can probably just open the terminal and type 'python'. For Microsoft Windows, see these options. If you have trouble, ask Sam or someone who has done this before for help.
- Install (if need be) a text editor (not a word processor - see my tools page).
- If you understand from the reading how to run a python program, do a few of the exercises at the end of chapter 1. (If not, ask Sam at a help session, or in class and we'll help you get going.)
- 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 11
input, output, numbers, loops
- Read chapters 2 and 3 in the text.
- Do and submit exercises 1, 7, 10 on page 49 & 50, from the end of chapter 2.
- Do and submit exercises 12, 14, and 16 on page 74, from the end of chapter 3.
- Please do leave me a note with your homework if you have any questions or comments.
due Tue Sep 18
strings
- Read chapter 4 in the text.
- In chapter 4, do these programming exercises on pages 119 to 121:
- 5 (acronyms) or 6 (name sum)
- 8 and/or 9 (on the Caesar cipher),
- 13 (formatted numbers), and
- 15 (read and summarize a file) on pages 120 and 121.
- As always, be smart about the time and effort spent on this stuff. If it's too much, focus your attention on a few. If it's fast, turn up the juice on some aspect that seems interesting.
- And if you get stuck, please do find or email me or Sam, and/or talk to other folks in the class. Often times a small hint can get you over a hump.
due Tue Sep 25
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 2
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 9
conditionals
- Read chapters 7 and 8. (This is a lot - feel free to skim bits of it and come back to those parts later.)
- Do exercise 7 from chapter 7 on page 229.
- Do exercises 11 and 12 from chapter 8 on page 263.
- Optional but recommended : 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.
- Optional and loads of fun : 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 22. (Next Tues Oct 15 is Hendrick's vacation; no homework due.) I'd like you to propose something that uses the what we've done so far : loops, conditionals, file i/o, ... 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 16
catchup
- Hendrick's Days -- no work due today.
- Continue work on your midterm project. (An optional progress report here would be great.)
- Or catchup with any missed work.
due Tue Oct 23
mid-term projects
- Create a midterm web project of your choice, using what we've done so far and demonstrating your mastery of it.
- Your submission should include
- the source code itself, including appropriate docs and comments.
- a brief writeup explaining what you did, what it's supposed to do, what was easy and what wasn't, and discussing the technologies involved.
- include a bibliography of any resources (websites, books, ...) you used
- Your grade will be based on the following evaluation categories :
- concept : the technical merit of the idea itself, including its difficulty and planning
- mastery : how well the project shows your understanding of the course material
- style : the clarity of your code and other materials, and whether it follows accepted conventions
- completeness : does it feel finished, and what bugs are there
- support : appropriate docs, tests, sample output, screenshots, etc
- Questions? Ask.
due Tue Oct 30
defining classes
- Read chapter 10
- Write a short python program that
- defines a class of your own invention, representing a "thing" of your choice
- inclues an __init__ and __str__ method
- includes at least three other methods, some of which take arguments, some of which return things, which modify the object's values and/or print things out
- has a main() function that creates several instances of these classes and calls some of their methods to do whatever it is that your "thing" does.
- 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.
due Tue Nov 6
more classes and data collections
- Read chapter 11
- Do exercises 14 and 15 from chapter 11 in the following way, using a "top down skeleton" approach.
- 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 skeletons for the classes and methods, with the args and a (fake trivial) return values for the classes. For example, if it's supposed to return some sort of string, just return '?'; if it returns a number, return 2. Please do *turn in* the these skeleton programs.
- Once the outline is set up and the code compiles, *then* implement and test the methods themselves. And turn in those, too.
due Tue Nov 13
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 more "oomph" now that your skills are growing.
- Again, clearly documented, and either tested or clearly demonstrated. doctests for functions recommended.
- Do use objects and dictionaries.
- Again, be clear what is your own new work, and what is work you or others have done previously.
- A first draft is due the Tuesday after Thanksgiving ... which isn't that far away.
- 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 20
recursion
- Read chapter 13 in the text
- Do at least one problem from from numbers 3, 4, 5, 6, or 8 on pages 463 and following
- Work on your final project, and give me a status report.
due Tue Nov 27
rough draft
- Please turn in a rough draft of your final project ... and get feedback.
due Tue Dec 4
class presentations
- Come to class ready to do a show'n'tell with your final project.
due Fri Dec 7
final project deadline
- Submit your final project, displaying all your cumulative skills.
- The format and rubric is the same as the midterm, namely
- Your submission should include
- the source code itself, including appropriate docs and comments.
- a brief writeup explaining what you did, what it's supposed to do, what was easy and what wasn't, and discussing the technologies involved.
- include a bibliography of any resources (websites, books, ...) you used
- Your grade will be based on the following evaluation categories :
- concept : the technical merit of the idea itself, including its difficulty and planning
- mastery : how well the project shows your understanding of the course material
- style : the clarity of your code and other materials, and whether it follows accepted conventions
- completeness : does it feel finished, and what bugs are there
- support : appropriate docs, tests, sample output, screenshots, etc
course grade
- a place for Jim to give overall feedback