The goal of this assignment is to make sure that you can
The shell is the program that interprets your
Unix commands. The shell tcsh has many nice features
that will make using Unix easier. If you are a new Unix
user, change your shell with the following command
chsh
You will be instructed to enter your Unix password.
Then it will prompt you to enter your new shell. Carefully
type
/usr/princeton/bin/tcsh
This will enable the following features:
The input file contains 5 or more positive real-valued stock prices, one per line.
For example, the file
sell.txt is:
1.0
2.0
3.0
4.0
3.0
Checking Your Work and Hints
|
- Step-by-step instructions for getting started and additional hints are available
here. If you are new to programming and/or are struggling,
this may be the best place to start. If you have some programming experience, you are
probably better off by not peeking.
- Run your program on some of the data files in
http://www.princeton.edu/~cs126/files/stock/.
- We supply working programs (plot126, pattern126,
and invest126) that you can use to check your work.
Instead of typing the command:
phoenix.Princeton.EDU% a.out < stock15.txt
Use one of the following:
phoenix.Princeton.EDU% plot126 < stock15.txt
phoenix.Princeton.EDU% pattern126 < stock15.txt
phoenix.Princeton.EDU% invest126 < stock15.txt
- At the very least, you should check that your output matches the output
given by our reference solutions for the sample inputs provided.
If it doesn't, try to figure out why.
Our sample data files may not throroughly stress every part of your code,
so you you may want to make up your own data files, and check that your program
agrees with ours on these.
You can also test your
code on real data from
NASDAQ.
Kevin Wayne