Assignment6: Object-Oriented Banking

Assignment created by Daniel George

Hello, everybody! For Assignment6, we are going to design a banking system using object-oriented programming and Python.

Project Requirements

Our banking system will consist of at least the following entities:

Make sure that you have included these two methods in some form in your system: You may need or may implement other methods; that's up to you! Make sure, though, that withdrawals may not exceed the available balance for at least a basic checking account in your banking system (or else, we could witness the decline of the money system as a whole).


We expect that you will turn in one file: a file which contains your object-oriented code.

Getting Started

This assignment will give you an opportunity to think creatively and also implement concrete code. It will probably be helpful to refer back to lecture 14, in which we explored object-oriented programming. Think about what entities your system will include, as well as which attributes each class will need. In particular, think about the relationships between entities: what pairs of entities demonstrate "has-a" relationships and what entities demonstrate "is-a" relationships (see the lecture notes for how to code these up!). Remember: one of the goals of CS253, and of great software engineering, is having a vision for the "big picture" (i.e., this kind of design) as well as the granular details.

In Python, setting up a class looks like this:

class Bank:
    def __init__(self, attribute, num=100):
        self.attribute = attribute
        self.number = num
    def bank_method(self, num):
        result = self.number + num
        return result
    # other methods and class attributes

A couple of notes about the above code:

In this assignment, you will definitely need more than just one class. It's not required that you actually run your code, but your submission should be logically coherent. In the event that you were to run your code, in Python, that works like this:

# to instantiate a class, assign an instance of that class to a variable, which looks like this syntactically
b = Bank("Daniel's Bank") # based on the code above, I pass in the string "Daniel's Bank" as the "attribute" arg

# I can now call methods belonging to the class, like this
result = b.bank_method(100)

# this will show 200

Due Date and Final Notes

Assignment 6 will be due on December 8, 2023 at 11:59pm CST. Above all...have some fun with this and your new skills with object-oriented programming!