[HOME] Math 127 (Policies) [Prev][Up][Skip][Next]


Programming Policy:

You are expected to have some experience with programming prior to this course, as many of the homework assignments will include implementing an algorithm. The programs you write will not be fancy, but they will require that you be comfortable writing and debugging programs of perhaps two to three pages in length. The types of programming features you should know are:

The programs we write will not require complicated programming statements; the sophistication comes from the algorithms that we will implement, not the language features you will be using.

You are allowed to use whatever language you like, with the following caveats:

I like JavaScript and Perl because I can run them without compiling them, so we don't run into any compiler incompatibilities. If you are going to use a compiled language, I would prefer that you keep the code generic. In particular, I don't want it to have any IBM/PC graphics calls or mouse I/O dependencies.

Some of you may wish to use Mathematica or some other computer algebra system to write your code. That is OK, although some assignments might be subtler in those languages. I do not have ready access to Maple or MatLab, so I would prefer you not use these as your programming language if it can be avoided.

When you turn in a programming assignment, you should include the following:

It is a good idea for your program to print out the values that were input (in which case, you can give me just the output). For example, if your program prompts for the coefficients of a polynomial and a value for a tolerance variable called "epsilon", and uses these to find an x-value where the polynomial is within epsilon of zero, your output might look like:

     Polynomial:  1 x^2 + -2 x + -5
     Root:  x = 3.449 (for an epsilon of .005)

If you are running on a Unix machine, you can capture the output of your program into a file using "redirection". For example, if your program is called hw1, then the command

    hw1 > hw1.txt

will capture the output of your program into a file called hw1.txt. Otherwise, you might need to cut and past the output into a text document by hand.

You can also store the input in a file and not have to retype it every time you run your program. For example

    hw1 < hw1.in > hw1.txt

read the input from hw1.in and stores the results in hw1.txt.

You may be able to get a file that includes both the input and the output by using the script command (see the man page for more details).



[HOME] Math 127 (Fall 2014) web pages
Created: 05 Sep 2014
Last modified: 05 Sep 2014 00:00:00
Comments to: dpvc@union.edu
[Next] Homework Policy
[Skip] Course Outline
[Up] Course Policies
[Prev] Office Hours