PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Send a file File manager PDF Toolbox Search Help Contact

assignment1 .pdf

Original filename: assignment1.pdf

This PDF 1.4 document has been generated by Writer / LibreOffice 4.2, and has been sent on pdf-archive.com on 26/02/2016 at 23:13, from IP address 37.228.x.x. The current document download page has been viewed 330 times.
File size: 39 KB (2 pages).
Privacy: public file

Download original PDF file

Document preview

Assignment 1
Due 03/03/2015

The Unix utilities head and tail output the first and last parts of files respectively. Your assignment is to implement your own version of one of these in C.

You will submit your code to both online codechecker and file submission. You will be randomly assigned your variation when you first click on Assignment 1 codechecker.
1. Variations:
either head or tail;
either even or odd line listing.
2. You should work independently, you may consult with each other but submit code that
is entirely yours. You are free to use any code from lectures and labs. Feel free to read
the source code of GNU head and tail but please don’t submit code based directly on
3. Submit a single .c file. Name the file exactly assign1-XXX.c where XXX is your student
4. In the comment block at the top, explain concisely what the program does and include
your name, student number and email address.
5. Note in the comment block how well you completed task (eg. Works completely; or x and y work
buy z does not;).
Use getopt to accept the following optional parameters:
{ head | tail } [OPTION ] . . . [ FILE ]
Print the first | last 10 lines of FILE to standard output .
If no FILE read standard input.
Options :
-n K output the first|last K lines
-V Output version info: Your name, email , student number , your variant.
-h display and exit ( something like this ) .

<depending on variation >
-e print even lines .
-o print odd lines .
The odd and even line printing may be a little bazaar and generally useless, but it is there to
test your programming. If -n 20, then your program should output 20 lines (eg. half of the
first|last 40 lines). Number the first line of the file as 1 when calculating odd and even.
• Submit code to both Codechecker and file submission before deadline.
-Ensure you press “Submit all and finish” before the deadline.
• Name your file as specified.
• Include a note on your progress.
• Make good use of lecture notes and labs.

assignment1.pdf - page 1/2
assignment1.pdf - page 2/2

Related documents

PDF Document assignment1
PDF Document uop prg 420 week 4 learn
PDF Document uop prg 420 week 4 learning team quality control
PDF Document uop prg 420 week 3 learning
PDF Document uop prg 420 week 3 learning team quality control
PDF Document e7 lab3

Related keywords