Due in parts: Part 1 due Tue 2/8/05 in class, Part 2 due by Sunday, 2/13/05
This assignment is primarily an exercise in problem-solving. I would recommend that you first think through the solution by drawing the design and writing psuedo-code (english like statements for code) before attempting to solve it in Java. Remember the comment-first coding that we talked about, and the object-oriented design methods we did in class. You will be somewhat building on the last assignment. In this assignment, you MUST use a file to read the currency conversion information. You are welcome to download a new version, but for your convenience, here is the version I used in Comma separated values (CSV) format.
In this problem you would be designing and implementing a mock up of a simple multinational Bank ATM. In this system, a user can create an account or Log in with an account number. When creating the account, the user should specify his/her name, account number, and the primary currency code for the account (see the example below). After that, he/she can make a deposit, make a withdrawal, or view Transactions
This assignment will be much harder than the first assignment. Because of this, I will have this assignment in two parts. Both parts have strict deadlines. The first part is due at the beginning of class on Tuesday 2/8/05, and is worth 15 points (out of 50). The rest of the assignment is due by the weekend. Notice that you are actually getting more time doing the design, so I expect that you spend as much time as possible on the design, and ensure that your design works by writing sample pseudocode if necessary.
As stated above, you will be developing an application for a bank, which will allow clients to open an account and deposit and withdraw money in any currency they want. As in the first assignment, follow the sequence of user input exactly, although you can feel free to change the prompts and displays that you generate.
Your bank can have several clients, although only one client will be using the system at a time. A client can log on by entering their account number and a PIN, which must be a 4 digit number. If a client does not have an account already, he/she enters a number (you can assume that number does not exist in the system), and the system prompts them for his/her name and PIN in that order. If an invalid PIN is entered, the system must keep prompting for the PIN until a valid PIN is provided. For a new account, the client must also specify the primary currency in which the account should be maintained (to avoid confusion, the currency must be entered as the 3 letter currency code).
Once created, the client may make deposits (with an amount, and a currency code), a withdrawal (with an amount, currency code, and a memo), and also view transactions. The transactions must be shown in the currency they were made, and the current balance should be shown at the bottom in the default currency. At any point, the client may check his/her current balance and or log out, which will send her back to the login prompt.
As stated earlier, you have to deliver two things: a design, and an actual working implementation.
Step 1. Design. Your design for this assignment consists of a UML class diagram. You will need to bring two copies of this class diagram. Make sure you have your name in both of these copies. In the class, you will also need to write a small amount of pseudocode using the classes you have designed. You can draw this diagram using Microsoft Powerpoint, Adobe Illustrator, Visio, or any other tool that you feel suitable, but it must be drawn using a computer program. Hand drawn diagrams will not be accepted. Your UML class diagram (not sequence diagram) must be complete showing your classes, their attributes, methods, and how they are linked between each other. You can write any assumptions you made for coming up with this design.
Step 2. Implementation. Name your main class BankApplication.java.
Feel free to create other classes as necessary. You will need to submit the
source for all the new classes that you create. Submit java files only, no class
files! DO NOT SUBMIT the Input class! Remember that java is case sensitive,
so make sure your class file has the same capitalization as shown.
A few things to remember:
Here is a sample run: You can use whatever text you want in whatever format to display the menus etc., but make sure that you accept only the correct type of input at each stage. This is needed for proper execution of your program - the handin system will not work unless you do this. In the following, the user input is shown in red.
============================================================================== Welcome to My Bank! Please enter your account number (or a negative number to exit). Enter Account Number: 123456 New user! Your name is: Jill Your PIN: asfdasdf Sorry, INVALID PIN - must be 4 digits. Your PIN: 0123 Your default currency: asfdasdf INVALID CURRENCY! Your default currency: USD Your default currency is set to United States Dollars (USD). Logging in... Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 1 Your balance is USD 0.00. Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 4 Sorry, No transcations found in the history. Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 3 Purchase amount: -10 Purchase currency: blah Purchase purpose: Lunch Invalid amount of transaction! Invalid currency of transaction! Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 3 Purchase amount: 30.00 Purchase currency: USD Purchase purpose: Lunch Invalid amount of transaction! (Not enough balance) Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 2 Amount of funds to add: 25 Currency of deposit: USD Your balance is USD 25.00 Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 3 Purchase amount: 15.23 Purchase currency: USD Purchase purpose: Lunch Your balance is: USD 9.77 Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 2 Amount of funds to add: 10 Currency of deposit: USD Your balance is USD 19.77 Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 1 Your balance is USD 19.77 Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 4 1. Deposit USD 25.00 1. Lunch (USD 15.23) 2. Deposit USD 10.00 Your balance is USD 19.77 Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 5 Goodbye, Jill! See you again soon! Welcome to My Bank! Please enter your account number (or a negative number to exit). Enter Account Number: 123456 Your PIN: 0123 Welcome back, Jill! Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 4 1. Deposit USD 25.00 1. Lunch (USD 15.23) 2. Deposit USD 10.00 Your balance is USD 19.77 Hello, Jill! Your options are: 1. Check Balance 2. Add Funds 3. Make a purchase 4. View Transactions 5. Log out Your choice: 5 Goodbye, Jill! See you again soon! Welcome to My Bank! Please enter your account number (or a negative number to exit). Enter Account Number: -1 Bye-bye! =================================================================================
Some notes and hints
Submission method You will need to submit your assignment using the online submission system. To submit, use the following steps: