| CSCI P545 Computer Science Department Indiana University | Wed Feb 20 14:54:31 EST 2008 © [SDJ] |
Write a program to reverse the contents of an array. Use whatever programming language you want. In addition to working data, your subdirectory must include these two files at top level:
dut.
report.pdf
dut)dut takes
input from stdin, which must
contains no more than 100,000 non-negative integers seperated by
new-lines and and nothing else.
These numbers are in the range from 0 to 216-1;
that is, representable in a 16-bit word.
stdout in the same format,
new-line separated non-negative integers in reverse order
from the input.
|
dut.c and compile with
to obtain executable object,
%gcc -o dut dut.c
dut.
To test this program, I'll create an ASCII file test-in.txt
containing the characters:
"12345"
(`'
stands for the Unix new-line character,
so this file would display as depicted to the right).
If I invoke dut with the command:
The result should be a text file
%dut < test-in.txt > test-out.txt
test-out.txt containing
"54321"
It is important to implement this program exactly as specified because, in the
second part of this assignment, other students will be "black-box testing"
your dut using their own
input and output files.
Instructions for Part A:
dut.
report.pdf, summarizing your journal.
duts) are a "black boxes" to be verified by execution on the
your test-input files and observing the results.
In testing, your primary focus is correct execution of
the dut. So at a minimum
you must document the results of your functional testing.
However, you should also pay attention to performance questions, (size, speed, etc.). In particular, try to estimate time-of-execution as a function of input-file size.
Instructions for Part B:
All testing, results and documentation are to be included in your working directory. More details will be provided later.
report to include the results of your tests.
dut program, N
(value yet to be determined) points are added to your score and
N points are subtracted from the implementor's score.
A tester may be able indirectly infer how your program works by measuring performance, (running times, size, etc.), and they are encouraged to make these estimates. But correctness is the primary concern.