Copyright 2021 Macquarie University. Data File Lab – Assignment 1 COMP2100 Revised 26 July 2021 Richard Han, XXXXXXXXXX This lab is the first of two assignments in COMP2100. Commences: Week 1....

1 answer below »
Hello, I need help completing my stage 2 in my Data File Lab Assignment. The assignment is coded in c in a Linux Environment. The server you will need to use is ssh iceberg.science.mq.edu.au. Once confirmed I will give you my username and password to login to the server. I am using Putty and I have already completed stage 1. You will need to read the assignment PDF very carefully to get a better understanding.


Copyright 2021 Macquarie University. Data File Lab – Assignment 1 COMP2100 Revised 26 July 2021 Richard Han, [email protected] This lab is the first of two assignments in COMP2100. Commences: Week 1. Progress: 10:30pm, Wednesdays of weeks 3, 4, 5, 6: 11 Aug, 18, Aug, 25 Aug, 1 Sep Due: 10:30pm, week 7: 8 September 2021 Value: 25% (16% for task, 4% weekly progress, 5% for code explanation) 1. Introduction This is the first of two programming task assignments in COMP2100. In this assignment, you will work with binary data stored in files, using the Unix I/O interface to read and write such files. The first part of this document describes the assignment (Data File Lab) in detail. Individual sections discuss an overview of the lab, how to fetch your personalised assignment specification, how you submit your work and obtain automatic feedback while you are working, and how the marking scheme works. The second part of this document describes each stage of the lab assignment. You should read this part to understand your task in each lab stage, and you should also refer to the personalised assignment specification for each stage. You obtain your personalised specification using the lab command. You should ensure that your personalised specification is kept secure at all times. You should also read the relevant support documents on iLearn in the section “Programming Task Support Notes”. The Lab Command Manual will enable you to perform key tasks including checking your marks and applying for free extensions – it is relevant to both assignments in this unit. There are documents that define what we expect in programming style, and support notes on C programming including some key ideas that are relevant to this Data File Lab. This document is Copyright © 2021 by Macquarie University. Neither this document nor any part of the assignment may be communicated to any unauthorised person or through any unauthorised service or website. 2. Overview of the Lab Data files exist in various formats. In Unix, text files are common for simple data, but large data files are stored as binary data. In this lab assignment (programming task), you will be developing programs to read, write, modify, and reformat the data in binary data files. The assignment consists of a sequence of stages which build on each other. The first three stages develop your skills. In the final stage you will reverse engineer a data file using your knowledge of data representations. You have the choice between an easier final stage (stage 4) that can earn you at most 3 marks for the stage, or a more difficult final stage (stage 5) worth up to 4 marks for the stage. You may attempt both stages 4 and 5, but only the maximum of the two marks will count towards your total. Copyright 2021 Macquarie University. The marking outline is: Section Value Stage 1 3 Stage 2 3 Stage 3 3 Stage 4 (max 3 marks) or stage 5 (max 4 marks) 4 Code style 3 Progress 4 Code comprehension 5 Total 25 Learning Outcomes This assignment will involve you in developing the following specific skills and capabilities.  Able to write programs that use C data structures, pointers and arrays.  Able to read and write binary data files, and write data in text format.  Able to convert between different data representations.  Able to use malloc and free to construct data structures using the heap.  Able to implement simple command line parameters.  Able to interpret and recognise binary data representations.  Research Unix library and system calls 3. Fetching your lab assignment The lab assignment files are accessed through the lab command which can be found at /home/unit/group/comp2100/lab There is no Unix man page for the lab command (it is not a Unix system command) but there is documentation on iLearn and if you don’t give it any command-line parameters or options then it will print out some brief documentation itself (a similar feature is common in many Unix programs). To see how this works, try the following command (where the $ symbol represents the Unix command-line prompt – you should type the command that is underlined in this example). $ /home/unit/group/comp2100/lab The option –g is used to get a lab stage. For example, to get lab 1 stage 1, do: $ /home/unit/group/comp2100/lab –g 1.1 For stage 2, the option would be –g 1.2 instead. Please see the Lab Command Manual in iLearn for more information about the lab command, including options for submitting assignments, getting marking reports, checking due dates and claiming your free extension days. Also, you can set up your Unix account so that you can abbreviate the command and just type “lab” instead of the full path name “/home/unit/group/comp2100/lab”. For the rest of this document, we will use the abbreviated name. The lab get command downloads your lab data as a tar file. For stage 1, the tar file is stage1.tar. Copyright 2021 Macquarie University. Tar is an archive utility (like zip) – it stores many files packed into one file. Use tar to extract the contents of this file. You can read all about tar in the Unix man page $ man 1 tar Here is the command to extract the contents of stage1.tar. $ tar xvf stage1.tar This will create a directory called stage1 and put the downloaded files in that directory. 4. Feedback during the assignment, submission and marking In this assignment, you can submit your code as often as you like, and receive immediate feedback and marks. There are rewards (progress marks) for working consistently throughout the assignment period and achieving stages of work by their due dates. Most of your final mark will be computed from the results of the automarker. A small number of marks are awarded for code style which is manually marked after the assignment closes. The maximum mark for the assignment is 20 marks. Of those marks, 13 marks are for achievements in the various stages, 4 marks are for progress and 3 marks are for code style. A. Introduction to COMP2100 automarking This is the first of two lab assignments in COMP2100. In both assignments, an automarker will track your progress and provide feedback to you. This is more than just telling you your mark – it is a feedback mechanism designed to help you as you work through the assignment. Firstly, the feedback is immediate, so when you think you have solved a problem you can submit your revised solution and see immediately whether it has enabled you to pass the automarker tests. Secondly, the automarker provides a detailed breakdown of your mark, which can help you isolate specific problems (such as a memory leak when using malloc and free). Thirdly, the automarker sometimes provides specific hints to help you understand what you need to address – such as identifying which columns of your data file are incorrect. You cannot rely only on the automarker, however. In this assignment, you will be provided with test data files, and you can and should compile your program yourself and run it on the test data files, examining the output yourself and identifying errors in your code. The automarker does not replace good old-fashioned debugging – one of the essential skills for all programmers. B. Individual work and information resources The stages of the lab are based on data files that will be provided to you. Each student will have their own specific data files to work with, with their own unique data format. This lab must be your own work. However, you may use resources on the Internet to obtain general information including information about the C language and libraries, information about binary and text data formats, and information about the operating system. If you obtain useful information from the Internet, you must include comments at the relevant points in your code acknowledging the source of the information (URL) and briefly describing the key idea(s) that you are using. (Exception: information from the Unix manual pages does not require citation in your program). The Unix manual pages are available online on ash and iceberg – use the man command. You can also find Unix manual pages online through Google. For example, to find out about the printf library call, use the command “man 3 printf” or Google “man printf” and to find out about the directory listing command ‘ls’, use the command “man ls” or Google “man ls”. However, you Copyright 2021 Macquarie University. should be cautious about using information found online because sometimes there are differences between different Unix systems and our systems may not behave exactly the same as described in some online documentation. The manual pages on the system (man command) are divided into sections: 1. System commands such as ls, wc, etc. 2. Unix system calls such as read(), open(), etc. 3. Unix library such as printf(), fopen(), etc. 4. Sections 4-8 contain other information. For more information on the man command, use the command “man man” to read the manual pages about the man command. C. Submitting your lab solution – achievement marks [13 marks] Your lab solution can be submitted using the lab command. The option –s is used to submit a solution to a lab stage. After the option, list all the files that you want to submit. Each time you submit, it is treated as a fresh submission, so you must list all the files that you want to submit every time. (If you find that tedious, learn about wildcards in the bash shell.) For example: $ lab –s 1.1 stage1.c sub.c defs.h The lab utility sends your submitted files to a server which compiles the C files together into a program, runs it, and tests that
Answered 1 days AfterAug 20, 2021

Answer To: Copyright 2021 Macquarie University. Data File Lab – Assignment 1 COMP2100 Revised 26 July 2021...

Ali Asgar answered on Aug 21 2021
141 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here