MET CS 565 W3 - Final Project - Due Wed April 30, 2003 (6:00 PM)
The Brokerage problem given in the Mid term exam will be the basis for the Final project. The project will be to build a GUI application for the "METBroker" brokerage firm. The GUI should be able to add/edit customers. When a customer is selected, the relevant information about that customer should be displayed, for example, name, ID, current balance, and the date account was opened. The application should be able to accomplish the following actions for the customer:
Enter and execute a buy/sell/deposit transaction (we can assume that we will do one transaction at a time).
Display the current portfolio (using JTable)
Display the portfolio at the end of any given day (using JTable)
Display the transaction history with the following choices for the transaction type: Buy/Sell/Deposit/All, and for the date range: From Date-ToDate/SingleDate (using JTable)
For the Brokerage itself, the GUI should be able to perform the following:
Load the initial data file about the customer's transactions. This should be done through the File->Load menu. Display the JFileChoser dialog to select the data file. Once the file is loaded, the customers should be shown in a JComboBox. When a new customer is added, that entry should be added to this combo box.
Add a New customer (Name, ID, Initial Deposit, and Date should be entered). This should be done through the File->Add Customer menu.
List all Customers in a JTable along with the data: Name, Id, Date account opened, current cash balance, current stock value, and the revenue for each as a result of transaction fees. Let us assume that the transaction fees will be a static variable of the Brokerage class with a value of 10.
Save all data back to a text file using the File->SaveAs menu. Display the JFileChoser dialog to select the data file.
For Dates, we will use integers with the value 1 signifying the establishment of the Brokerage firm.
Now consider a database with the following tables and the corresponding fields: (I will provide an Access database with initial data)
Accounts --- with Fields: CustomerId (customer id, string, primary key), CustomerName (string), OpeningDate (integer), OpeningBalance (double)
Transactions --- with Fields: CustomerId (string, foreign key), TransactionDate (integer), TransactionType (string, Buy/Sell/Deposit), StockSymbol (string), Quantity (double), Price (double).
StockQuotes --- with Fields: StockSymbol (string, primary key), StockPrice (double, current stock price)
StockHistory --- with Fields: StockSymbol (string), SDate (integer), StockPrice (double, the stock price at the end of that Date)
The initial data can also be loaded from the database, using the File->Load From Database menu. We will prompt the user for DSN and assume that we will be using the JDBC-ODBC bridge. When a new customer is added, a new row should be inserted into the Accounts table. When a new transaction is entered, a new row should be entered into the Transactions table. The stock quote for buying and selling should be retrieved from the StockQuotes table. The value of a stock at the end of any day should be retrieved from the StockHistory table. You should also write the functionality for saving all data back to the database invoked through the File->Save to Database menu. The data in Accounts and Transactions table should be cleared and the current data should be written into those tables.
The Java code should be organized as follows:
class Brokerage extending JFrame and contains the "main" method
class Account
class Transaction
class Stock