Files

33 lines
1.1 KiB
Plaintext

stats {-rows|-cols} [input_file]
DONE: Numbers are separated by tabs, lines by newlines
DONE: Check for the correct number of arguments, failure to standard error
DONE: Check whether file is readable, or exists, stderr if not
DONE: -rows and -cols should work for anything that starts with its character eg. -rad would do rows
Stats output to stdout
Exit value for errors should be 1
You can assume each row will be less than 1000 bytes long, unix limits this, but unlimited numbers of rows
DONE: If using temp files, make sure they include process id's in name to allow for simultaneous runs. Remove files when done.
DONE: Use the trap command to catch interrupt, hangup, and terminate signals to remove temp files if terminates unexpectedly
Values and results must be whole numbers, round like normal, 7.5 to 8, 7.4 to 7
DONE: Calculations must be done with expr or commandline tools. No other languages
DONE: For median, sort values and take the middle value. If even, take the larger of the middle two values.
DONE: Must be in a single file.
DONE: You can return an error if there is no input file
HINTS