CS 331 Spring 2009  >  Assignment 4

CS 331 Spring 2009
Assignment 4

Assignment 4 is due at 5 p.m. Thursday, April 16. It is worth 25 points.

Procedures

E-mail answers to the exercises below to ffggc@uaf.edu, using the subjectPA4”.

Exercises (25 pts total)

Exercise A — Basic Python

Purpose

In this exercise, you will write some simple Python functions and classes.

Instructions

Write code meeting the requirements outlined below. Place all of this in the file pa4.py. I prefer that you use Python 3. However, if this is not available to you, some recent version of Python 2 is acceptable (2.5 or 2.6). If you use a version of Python before 3.0, you must let me know this in your e-mail.

Test Program

I have written a test program: pa4_test.py (Python 3 version) or pa4_test_py2.py (Python 2 version). If you run the test program with your package, then it will test whether your package works properly.

To do the testing, place the test program and your file (pa4.py) in the same directory, and run the test program (e.g., at a Unix prompt, type “python3 pa4_test.py” or “python pa4_test_py2.py”).

Do not turn in the test program.


CS 331 Spring 2009: Assignment 4 / Updated: 15 Apr 2009 / Glenn G. Chappell / ffggc@uaf.edu Valid HTML 4.01!