Reminder

  • If you haven't done so already, please fill out the COS 126 student survey. It will only take a minute. Otherwise your name will not get entered in our database, and you will not receive a grade in this course.

  • Goals

    The goal of this assignment is to make sure that you can

  • Read data from standard input.

  • Use loops (for, while).

  • Use branches (if, else).

  • Unix tip of the week

    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 backspace key will work properly.

  • Use the up-arrow key to recall previous commands.

  • Use the Tab key to complete filenames. For example, instead of typing "gcc126 alongfilename.c", simply type "gcc126 alo<Tab>" and the shell will automatically complete the filename for you.

  • Input Format

    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


    Submission and readme

  • Use the following submit command:
    submit126 1 plot.c pattern.c invest.c readme
    
    Do not use different file names. Use submit126; the command /u/cs126/bin/submit is now obsolete. All your files should include your name and precept number.

  • Here is a template readme file for this assignment. It should contain the following information:

  • Your name and precept number.

  • A high level description of your program and your approach to solving it. There is no need to regurgitate the statement of the assignment.

  • Describe any problems you encountered in completing the assignment. List whatever outside help (if any) that you received.

  • Enrichment Links

  • You can also test your code on real data from NASDAQ.



  • Kevin Wayne