PROJECT 1: TRANSACTION PROCESSING
DUE: NOON, MARCH 1st 1999
It’s a balmy Monday morning in Silicon Alley as you, the consulting firm’s new hot shot programmer, check your e-mail while slurping the day’s first dose of caffeine. In between the note from your last romance (begging you to come back) and the some insider information from your broker (suggesting yet another way for you to invest your hard earned signing bonus), you notice a small item from the firm’s CEO, Wendy H. Ikeman-Perkins. It turns out that a leading multinational bank has hatched a bold plan to cut cost by selling all it’s ATM’s and using grocery store cash registers instead, the cashiers will double as tellers. So, instead of having to waste valuable TV-viewing time by standing in line at the ATM, consumers would be able to open accounts, deposit and withdraw money, and transfer funds as they are paying for their groceries. Your firm’s marketing representative, Walter U. Serin-Srhivier, landed the contract by telling the bank president that: "we could put our world class Java team on the job and have it done in two weeks." You chuckle a little as you wonder who old Walt managed to cajole into agreeing to develop such complex product under such an impossible schedule. You fire up the web browser and start surfing for the best deals on graphics accelerators, when you recall that during last week’s status meeting Wendy introduced you to the group as "our world class Java team".
Since Wendy’s cubicle is right next to yours, you decide that a quick one-on-one meeting is in order. After finding you a chair, she calmly assures you that the product is not all that complex – all it needs to do is manage Savings and checking accounts for up to twenty customers. Unfortunately, it’s impossible to extend the deadline because the Bank’s board of directors are flying in from Dubuque, Iowa for a demo in two weeks, and the super-saver airline tickets they purchased are non-refundable. You point out that the project’s specifications are somewhat vague. In response, Wendy presents you with notes describing the functionality of the product which Walter carefully jotted down on the back of six napkins during his "power" lunch meeting with the bank’s Chief Information Officer.
Always up to an intellectual and technical challenge, you tell Wendy not to worry and return to your cubicle with your six requirements documents. You immediately begin designing the system, stopping only to e-mail your resume to a few head hunters. The imprint of two golden arches on Walter’s napkins look vaguely familiar, but you don’t take time to ponder their significance. A detailed analysis of the specifications reveal the following requirements. The bank does not want to have to upgrade the cash registers’ graphics, so a Java application is in order.
The system needs to perform 9 transactions :
In order to do all this, the cashiers will type in a series of transaction commands, one transaction command per line. Every line will start with the type of transaction requested. All monitary amounts are to expressed in terms of pennies.
There are only seven valid transaction commands :
Accounts can be created with the command "create" followed by three or four entries.
Money is deposited into existing accounts with the "credit" command – followed by the account number and the amount. Deposited amounts must be positive.
Money is withdrawn from existing accounts with the "debit" command – followed by the account number and the amount.
Balances are show with the "balance" command. If the "balance" command is followed by a valid account number, then the balance for that account is printed out. If the account number is not valid, then an error message should be printed. If "savings" follows instead of an accont number, then the account numbers and balances of all the savings accounts should be printed. If "checking" follows, then the account number and balances of all the checking accounts should be printed. If "balance" is typed in with nothing following, then the account numbers and balances of all the accounts should be printed out.
The "transfer" command is followed by two account numbers and an amount. The amount should be transferred from the first account to the second account.
The "update" command is used to post interest and charge fees. When this command is typed with "savings" after it, all savings accounts should acrew 2.5% interest. When "update checking" is typed all checking accounts with less that a $2,500.00 balance should have a $10 service fee deducted from its balance. A $1.00 service fee is deducted from all checking accounts for each transaction (deposit, withdraw, balance) since the last update.
The "exit" command is used to leave they system. When the system is exited, the account number and balance for all accounts should be printed out, so that the cashiers can type them back in at the beginning of the next day.
A sample session appears below. User input is unlabeled. Computer output is indicated by the ">" character.
open savings 1234
credit 1234 5000
balance 1234
> Account # 1234 Balance $50.00
open checking 5768 10000
transfer 1234 5678 2500
balance
>Account # 1234 Balance $25.00
>Account # 5678 Balance $125.00
>All accounts balance $150.00
debit 1243 1500
credit 5678 2500
balance 1237
> No such account # 1237
debit 1234 100000
> Insufficient funds
update
exit
>Account # 1234 Balance $10.25
>Account # 5678 Balance $87.00
>All accounts balance $97.25