Carnegie Mellon University Website Home Page
 
Spring 2008  |  Mini 3

Homework 4 - Stock Market Competition

(Demo in class @ 8:30am Thursday, 2/28; Submitted to Blackboard @ 23:59 2/28)

Background

We are creating a Web App that the Business students can use for their Stock Market Investment Competition later in March. The necessary functionality and deadlines are detailed below.

Part 0 - Team Partners

Please submit your choice of team partner by Tuesday, 2/19

Part 0.5 - Design Document

The major components of your web application, broken down by model, view, and controller, should be summarized and submitted to Blackboard for review by Thursday, 2/21.

Part 1 - MySQL

As we outlined together in class, the initial MySQL database is available here.

The file can be loaded by starting a command prompt (as we demonstrated in class) and doing:
mysql -u root < stock_competition.sql

Remember, for this to work, stock_competition.sql must be in your current working directory (which should probably be the db directory of the stock_competition project).

If the file looks like it loads cleanly, be sure to go into MySQL and check it out.

Part 2 - Core Requirements

This core functionality must be demonstrated in a ten-minute demo to the TA on Sunday, 2/24. Email your preference for a time, excluding 11:30am-1pm and 4-5:30pm, and be prepared to present during that time.

Project Name

  • The name of the project should be "stock_competition".
  • When generating the project don't forget to specify a database type of MySQL.

Database

  • Though the name of the database must stay the same, if your extra features (as discussed in part 3) require additional modifications to the tables in the database, then please provide a .sql file to generate it when you submit your project.

Public Scoreboard

  • A publicly viewable scoreboard must be available at the discretion of the competition administrators (see "Administrator Functionality").
  • The scoreboard must display (in ranked order) the team name as well as the sum total of their cash on hand and the value of their portfolio. This number is used to compute the rank, and the team with the highest total is first, with the rest following in order.
  • A team must not be able to infer any aspect of the transactions for another team based on the scoreboard.

Team functionality

  • Each team must have an individual login (one account/password per team) and (as far as is possible) must be prevented from violating the rules or spirit of the competition (e.g., performing a transaction as another team, making an invalid/illegal transaction, etc.)
  • Teams must be able to make transactions that appropriately adjust their available funds, including the commission charged for making a transaction (QR30)
    • A transaction must be either a "buy" or a "sell" transaction.
    • A team should not be able to sell more shares of stock than they possess, nor buy more shares of stock than they have the money for (including the commission charge).
    • The number of shares of stock available for purchase should only be limited by the amount of money a team has available.
    • A team should be able to buy or sell multiple shares of stock (instead of buying/selling one share of stock at a time).
    • The price of a particular share of stock should be calculated after the transaction has been requested. This means if a team loads the "buy stock QTEL" page, the value of the QTEL stock should be calculated after the buy action has occurred. If you "pre-load" the value of the stock, and the team stays on the page for several hours, the value of that stock will most likely have changed during that period of time and thus would be purchased at the wrong price (which leaves an opening for abuse).
    • The code for getting the current price that Meg demo'd in lecture is available here.
  • The transaction history for each individual team must be made available to each team, though it should not be accessible by any other team.
  • The team's portfolio must be available for them to view the shares of all the stocks in their possession.
  • An HTML table containing a list of stocks and their current prices should be available to the team (you may want to research how to automatically refresh this page). Hint: this would be a very nice warmup action/view to implement.

Administrator Functionality

  • Teams must be prevented from accessing all administrator functionality.
  • The administrators must be able to do all things necessary to begin and end the competition. This means that no team must be able to make a transaction before or after the competition has begun or ended (respectively).
    • A simple way of doing this would be a "begin" or "end" competition button.
    • A more complicated way of doing this could include an administrator settings page that includes a start and end date.
  • The scoreboard should be viewable when the administrators decide it should (how you choose to implement this is up to you).
  • Only the administrators must be able to create a team account and password, as well as specify an amount of starting money (should default to QR150,000).
  • Administrators should be able to view all transactions for all teams as well as the scoreboard at any time.

Part 3 - Bonus Features

Grading is based on core functionality, but selection for use in the competition will more likely be based on your creativeness in this category. Likely candidates for improvement include:

  • Design and usability
  • Preferences for how the administrators or teams can display their transaction history
  • Extra features or enhancing existing features, such as:
    • display the best/worst transaction (i.e., the transaction that made the most profit or had the most loss)
    • display the best/worst performing stock over the run of the contest
    • (dynamically) generate a bargraph showing the fluctuations in the value of their portfolio

Part 4 - Presentation

Each team will present their final project during the three-hour final time-slot on Thursday, 2/28 starting at 8:30am. Be sure to dress appropriately, be professional, and most important, demonstrate why your project should be the one selected to run the competition.

This presentation accounts for 10% of your final grade.

Small adjustments can be made following the presentation (perhaps as a response to feedback from the competition organizers) and should be submitted by 23:59 on the day of the presentation.

Handin (by 23:59, 2/28)

  • Please zip up and submit the "app" and "public" folders, including any other files or directories that are required to recreate your project (e.g. A new sql file containing changes you made to the database).
  • Call the file <AndrewID1>_;<AndrewID2>_competition.zip
  • Submit it under the "Lab 4 - Stock Competition" on Blackboard