Final Project: MarketSim

Due: Monday, December 7, 1998

Purpose of the project:

The purpose of the final project is two-fold:

Setting up a team:

If you like, you can do this entire project by yourself, but we strongly encourage you to work in groups of 2-3 people. Try to set up your team as soon as possible. Once you have your team in place, start brainstorming together about how you might solve this particular project. Then, figure out an effective way of dividing up the work.

Design Review Meetings:

Once you have had your initial brainstorming meetings, your group may want to meet with me to discuss your overall strategy for completing the project. These meetings are not required, but you may find them useful, when and if, you get stuck. Either stop by my office hours (Mondays, 10 am -12 noon.) Or send me email at: cerami@cs.nyu.edu, and we can set up an appointment.

Extra Credit:

The final project provides a great deal of opportunity for extra credit. The entire project is 100 points, but you can do up to 40 points of extra credit work. If you did not do as well on the midterm as you would have liked, this is your chance to make up the work. Suggestions for extra credit functionality are provided below.

Grading:

The final project is worth 15% of your overall grade.

Description of Final Project:

For the final project, you are to create a market simulator which enables users to buy and sell shares in any of five active companies. At the start of the program, the user is given $1,000 in cash and each company is give a random share value between $20 and $40 (you can use integer values, and need not worry about using floats.) On any particular day, the user has five options:
  1. Buy Socks
  2. Sell Stocks
  3. View Current Stock Prices
  4. View the portfolio
  5. Wait out the day
  6. Exit the program
Each of these options is outlined below.

Viewing Current Stock Prices:

This option will display the company id and its current price per share. For example, here is some sample output:
Today's Stock Prices:
*********************
Company #0:  35
Company #1:  39
Company #2:  39
Company #3:  33
Company #4:  34

Viewing the Portfolio:

This option will display the company id, the current price per share, number of shares owned, and total value of the stock holding. It will also display the total amount of money held in stocks, the total amount in cash, and total value of all assets. For example, here is some sample output:
Your portfolio:
#       Price   Shares  Value
******************************
0       35      10      350
1       39      0       0
2       39      0       0
3       33      0       0
4       34      15      510 

Total Money in stocks:  $860
Total cash reserves:    $140
Total Assets:           $1000
Here, you can see that the user still has total assets worth $1,000. $860 of that is in stocks, $140 is in cash. The user also own 10 shares of company #0 and 15 shares of company #4.

Waiting out the day:

This option assigns new random share values to each of the five companies.

[Extra credit option: Add more realistic fluctuations to the stock price. For example, instead of randomly generating entirely new value, generate a random price change (e.g. each stock price can go up or down by 0-5 points)]

Buying Stocks:

The user can buy stock in any company, so long as he/she has enough cash to carry out the purchase. He is some sample output:
Please select an option:  1
Enter company to buy:  2
Company #2 is currently trading at:  $20
You currently have $1000 in cash.
Enter number of shares to buy:  5

You have just purchased 5 shares in Company #2
Total Cost:  $100
In the event that the user does not have the cash to buy this stock, just inform them of this fact. For example:
Please select an option:  1
Enter company to buy:  1
Company #1 is currently trading at:  $21
You currently have $900 in cash.
Enter number of shares to buy:  100
You do not have enough cash to complete this transaction.
You do not need to provide any other error checking. For example, you can always assume that the user enters a valid company id (0-4)

[Extra Credit Option #1: Any extra error handling]
[Extra Credit Option #2: Charge a $20 brokers fee for each buy/sell transaction.]

Selling Stocks:

The user can sell any stock he/she wants to. Here is some sample output:
Please select an option:  2
Enter company to sell:  2
Company #2 is currently trading at:  $20
You currently have 5 shares in the company.
Enter number of shares to sell:  2

You have just sold 2 shares in Company #2
Total Sale:  $40

Just make sure that the user does not sell more stock that he/she actually owns. For example, the user has 5 shares in company #2. Don't let him sell 25 shares! Sample output:

Please select an option:  2
Enter company to sell:  2
Company #2 is currently trading at: $20
You currently have 5 shares in the company.
Enter number of shares to sell:  25
You do not have than many shares.

Demonstration Program:

The best way to see how the program works is to see it in action. Click here to download a sample executable file. This executable program provides all the bare bones functionality required to get a 100 on the project (i.e. it does not implement any of the extra credit options.)

Extra Credit Options:

Here are some options for extra credit. When you submit your program to the grader, please be sure to tell him which extra credit options you have implemented.