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 multiple Python classes 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 in).
  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 (transfer between accounts) or accounts (savings, another checking) 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__':
        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.

Grading

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

Grading Rubric
Type Description Deduction (points)
SyntaxError Exceptions A program that doesn’t even start due to syntax errors. -30
Docstrings Missing proper lab header (e.g. no name, lab section, etc) -10
Docstrings Missing proper lab header (e.g. no name, lab section, etc) -10
main() Your program should have main() as the first-called function -10
__name__ == '__main__' Missing condition execution statement involving 5
PEP 8 Style Egregious problems with your code styling -10
Incorrect Filename Follow the submission instructions -5
Commenting Insufficient or excessive comments -5
Multiple Classes Classes must be used to solve this lab -50
Interactivity Interactive for ATM commands, e.g. withdrawl, deposit, etc) -15
Proper OOD Appropriate object-oriented design style must be used -20 points
Checking Account Each user in your program should have at least a checking account -5
Account Actions Allow a minimal set of useful operations like check balances, withdraw cash. -10

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.