Assignment 1 submission instructions: test cases that must be run

Due date

The assignment is to be turned in by Monday, April 15th by 6:50pm.
 

What to submit

You are to submit six files: riemann.p, funcs.p, main.p, riemann.c, funcs.c, and main.c.  As mentioned in the Assignment 1 handout, riemann is to contain the two Riemann functions, funcs is to contain the four math functions (tangent, square, reciprocal, and twotothepower), and the main file should contain the drivers for the program.  You may have make files and header files if you think that is good software engineering practice.

In both main programs (C and Pascal), you must test the lriemann and rriemann functions using the four functions that you created.  Below are the ten test cases that you must have in both main programs.  These are the tests that will be graded.  Use your knowledge of calculus to determine what the result of each test case should be.  Please organize the main file well so that it is easy to find these test cases.

  1. lriemann with f = square, a = 0, b = 3, and n = 3.
  2. rriemann with f = square, a = 0, b = 3, and n = 3.
  3. lriemann with f = reciprocal, a = 0 , b = 2 , and n = 2.
  4. lriemann with f = reciprocal, a = -2, b = 2, and n = 25.
  5. rriemann with f = reciprocal, a = 0, b = 2, and n = 2.
  6. lriemann with f = tangent, a = -2, b = 4, and n = 8.
  7. rriemann with f = tangent, a = -2, b = 4, and n = 8.
  8. lriemann with f = twotothepower, a = 1, b = 5, and n = 0.
  9. lriemann with f = twotothepower, a = 0, b = 8, and n = 25.
  10. rriemann with f = twotothepower, a = 0, b = 0, and n = 2.
Remember that the signature of the Riemann functions is (real -> real) x real x real x integer -> real.  Therefore, even if the Riemann sum approximation is unable to be computed (perhaps because a division by zero is required), the function must still return a real number.  In this case, you need to report to the user that the Riemann sum approximation is 'undefined' in a sensible way, but so that what the function returns is still consistent with the signature.  It is up to you to determine the best way to do this.

Using turnin to submit your assignment

You will use the turnin program to submit your assignment.  The step-by-step instructions for using the turnin program are posted on Discus on the Assignment 1 thread, and are repeated here for convenience:

1. log in to ieng9

2. if you have one file, skip to step 4

3. if you have multiple files, create one file using the "tar" command. i.e.

% tar -cf myproject.tar file1 file2...


4. turnin the project using:

% turnin -c cs130s -p project1 project_filename


Here "-p project1" refers to the name of the project, not the file you are submitting.

Note that you cannot submit multiple files using "turnin" -- you must create a tar file to do that.