Lab 11: Objects

For this lab, you will prepare a single python file: account.py . This file should implement functionality for a bank savings account.

I am providing the following files for you:

Defining an Object

An object contains some data, and can perform some actions. The data are called instance variables, and the actions are called methods.

Every object needs the following methods:

In addition to __init__ and __repr__, an object will have other methods. In our case, we define the method speak(self).

Using Objects

Once you've defined an object's class, you can use it in several ways:

Your Task

In the file account.py, define a class called Account. The class should contain the following instance variables: All these instance variables should be created in the constructor. The class Account should define the following methods:

Turning in your work

Be sure to turn in whatever you have finished, at the end of the lab session. You may continue to work until midnight, and submit your work again.

Late penalties: 1 day late: -5%, 2 days: -10%, -3 days: -20%.

To turn your work in, go to mycourses.unh.edu, find CS414, open the syllabus, and click on Lab 7. Then click Submit Assignment, click Choose file, then find your file account.py, and upload it.

Files For Downloading

Here are files for you to work with: