Object-Oriented Design

Your Assignment

This assignment will test your ability to design classes from a description of a problem. This lab is mostly free-form in style.

You will write a program that simulates an Automatic Teller Machine (ATM). Each user will have access to only a checking account. Design your interface to be similar to what you see on your local ATM.

Assignment Requirements

  1. The purpose of this assignment is to test your object-oriented design abilities.
    • You will need write Python class(es) to solve this problem.
    • Remember, you will use the basic principles of constructing classes as discussed in class. Figure out your nouns, verbs, and the properties of your problem.
  2. Since debit card swiping is not possible here, instead ask the user of your program for user id and a PIN. The user id will be used to look up the info for the user’s accounts (including the PIN to see if it matches what the user types).
  3. You can program some fake accounts and holders directly into your program, with starting balances, i.e. “Joe Smith” has user id jsmith and a balance of 1350 US dollars. You can program in any number of users you need. Hint: A dictionary is great for this.
  4. The user should able to check the balance of, withdraw from or deposit into their checking account. You can add other actions of your own, as well in addition to the require ones.
  5. You should have a main() function that uses any classes you wrote in some sort of interactive loop.
  6. The rest is up to you!

Submission Requirements

There are a few standards to adhere to when submitting your lab. Please read, and follow them carefully.

  1. Submission Filename: Submit a file named lab_ood.py.

  2. Documentation String (“docstring”): The following docstring (properly edited with your name) needs to be the very first thing in your Python program file.

    """CSC 161 Lab: Object-Oriented Design
    This lab...
    Fox Mulder
    Lab Section TR 2:00-3:15pm
    Fall 2015

    Read more about docstrings: Program Documentation String

  3. Comments (lines prefaced with #): Unclear parts of your code can receive point deductions, so be judicious about using comments. Do not overuse comments. Too much unnecessary commenting can complicate reading otherwise clear code!

    Read more about comments: Program Comments

  4. Python Code Style: You will need to run your Python program file through the online PEP 8 style checker found in CSC 161 Style.

  5. The __main__, top-level script environment” check is required:

    if __name__ == '__main__':

    You can read more about this trick on the official Python website.

The Blackboard post for this lab assignment will contain the details regarding the due date and other details regarding class administration for this assignment.


The following is the grading rubric for this lab to be used by the course graders. The lab is worth 100 points.

Here’s a brief grading rubric:

  • Syntax errors: -30 points
  • A bad/missing docstring (i.e. no name, lab section, etc): -10 points
  • The submitted filename is wrong: -10 points
  • No Python comments used when they are needed to clarify code: -5 points
  • Code doesn’t attempt to adhere to Python coding style: -10 points
  • Your top-level script environment check is missing: -5 points
  • Missing main() function: -10 points
  • Class(es) must be used to solve this lab: -50 points
  • Your program must be interactive (in order to receive commands like withdrawl, deposit, etc): -15 points
  • Since you are using classes, appropriate object-oriented design style must be used: -20 points
  • Each user in your program should have at least a checking account. -5 points
  • Each user in you program should able to do a minimal set of useful operations like check balances, withdraw cash, and transfer money between a user’s own accounts. -10/each.
  • Otherwise, the solution to this assignment is open to interpretation, there won’t be one “right way” to do this so long as the basics are followed.

Extra Credit

There is no extra credit for this assignment.