Goals, Skills and Concepts:
- learn basic syntax of new language
- design and implement a relatively simple class
Introduction and Background:
Since we don't have much time for this assignment we will build a new class into the program we just completed. We will create a class that will allow us to encapsulate all the account-related code within a single class..
Description:
In the previous assignment, you created a Java application that emulates a simple ATM ('Bank.java' ). This program does some of the things a simple Automatic Transfer Machine does: it gives us access to out bank accounts and allows us to deposit money, withdraw money, and display a balance. The 'A' version also allows new accounts to be created and old ones to be closed.. Users may loop as often as desired.
What we need to create is a class to 'replace' the account stuff in this application with a single class. We will need to create at least the following operations for this class:
balance
deposit
withdraw
A-version: new account
A-version: close account
Specifications:
You may use your own application from last assignment if desired but it's not necessary. A sample 'main' will be provided.
You may NOT change the basic functionality of the program.
Do not re-design the existing program. Follow the basic algorithms as given.
Approach:
This is a smallish addition, requiring no new material except a simple class. For a sample of the 'Bank' program that uses this account class, see: 'ATM_C.java' . There is also a bytecode version of the Account class. This is the one used by ATM. All can be found in ~becker/Courses/233/A2
Requirements & Grading:
'C' Version:
- new class, no frills
- seperate class (in seperate file, for instance Account.Java)
- replaces account variables (and related procedures) with almost no change to the remaining code
'B' Version:
- everything the 'C' version does, but with multiple accounts to choose from
- number of accounts can be a finite value [like, 5 pre-defined accounts]
'A' Version:
- everything the 'B' version does but allows for creation of new accounts and closing of old ones. Use same "rules" as in original version [i.e. account must be clear before it can be closed]. Maximum number of accounts can still be finite.[unlimited accounts is bonus]
Testing:
BONUSES:
1. [up to 6 points] Allow an unlimited number of accounts
2. [up to 6 points] Allows more flexability w.r.t. account 'names'
Challenges:
Not this time. On some assingments, the most involved and challenging bonuses (OK, sometimes just stupidly hard or rediculous amounts of work) will be listed under this category.