assignment1 (PDF)




File information


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 486 times.
File size: 39.88 KB (2 pages).
Privacy: public file










File 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
this.
3. Submit a single .c file. Name the file exactly assign1-XXX.c where XXX is your student
number.
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 .
<or>
-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.
Check-list:
• 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.






Download assignment1



assignment1.pdf (PDF, 39.88 KB)


Download PDF







Share this file on social networks



     





Link to this page



Permanent link

Use the permanent link to the download page to share your document on Facebook, Twitter, LinkedIn, or directly with a contact by e-Mail, Messenger, Whatsapp, Line..




Short link

Use the short link to share your document on Twitter or by text message (SMS)




HTML Code

Copy the following HTML code to share your document on a Website or Blog




QR Code to this page


QR Code link to PDF file assignment1.pdf






This file has been shared publicly by a user of PDF Archive.
Document ID: 0000343658.
Report illicit content