University of Washington, Bothell
CSS AP442: Advanced Programming Methodology I
Homework Assignment 1: Object Relationships
Assigned: 8 October 1998
Due: 27 October 1998 (start of lecture) or sooner
The purpose of this assignment is to give you experience designing an implementing a program as a collection of interacting objects. You are asked to extend the Counters hierarchy presented in the textbook (JOFA), and create a new class who's objects will contain and manipulate objects of your extended counter class. Additionally, by the end of this assignment, you will be familiar with the mechanics of Java software development and object-oriented design using UML/OMT notation.
You are asked to design and implement a Java program which simulates the operation of an ATM, or automatic teller machine. You will do this by first extending the Counters hierarchy, creating a new BankAccount class. A BankAccount has attributes such as a ``balance'', ``account number'', etc., and actions including getBalance(), deposit(), and withdraw(). It is similar in many respects to the MoneyRegister class defined in Chapter 5 (though not exactly the same).
You should then design a second class, ATM, which is not part of the Counters hierarchy. An ATM manages a number of BankAccounts (it contains them; you choose the data structure you feel is best). An ATM provides a number of actions, such as displayWelcomeScreen(), readCard(), etc.
Write a program which allows a user to interact with an ATM. Your program should first create a single ATM object, which can be initialized with a fixed number of BankAccounts (for simplicity's sake, their account numbers should be made sequential, starting with 1). Each account should begin with a balance of zero. After initialization, the program should display a welcome screen and ask the user to enter an account number. The user should then be asked to make a transaction choice from a list of options. The appropriate action should be carried out (possibly requiring prompting the user for more information beforehand), followed by a return to the list of options. When a user selects ``quit'' from the option list, the program should return to the welcome screen.
You will be submitting your source code separately from your documentation. Please email your source code to firstname.lastname@example.org. Each file should be sent in a separate email message, with the subject line including your student ID and the complete file name. Your application must be called ``ATMDemo.java'' (so that we know what to run without having to search for main() in all your files). Any email sent after the start of class on 27 October will be counted as a late submission. You will receive an automated response, which you should save as a receipt of submission.
Please submit your documentation as hardcopy in class. Include information about the status of your assignment, if it is not completely working.
This document was generated using the LaTeX2HTML translator Version 98.1p1 release (March 2nd, 1998)
Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html -split 0 assn1.
The translation was initiated by Dr. Michael Stiber on 1998-10-08