1. Homepage
  2. Exam
  3. [2022] COMP9315 DBMS Implementation 22T1 - Final Exam - Q2 Longest Tuple

[2022] COMP9315 DBMS Implementation 22T1 - Final Exam - Q2 Longest Tuple

This question has been solved
Engage in a Conversation

Question 2 (20 marks)

The q2 directory contains an incomplete program q2.c. You must complete this program so that it finds and prints the longest tuple in a "no-frills" data file (see [Q1-3 Info] for details on what a "no-frills" data file is). The name of the data file is supplied as a command-line argument, e.g. CourseNana.COM

$ ./q2 data/Data1
rtmeplzf,yjbjivazjj,txaqfxbctg,kbbq,mqanq
$

If the file is an empty "no-frills" file (one page containing zero tuples) or is a completely empty file (zero bytes), you should print "<none>". If the last page is longer than zero bytes but less than PAGESIZE, the file is not a valid "no-frills" data file, and so you should also print "<none>". CourseNana.COM

Note that q2.c already does all of the command-line argument handling, and opens the data file for you. By the time your code runs, fd should contain a valid file descriptor for reading the data file. Note also that while the supplied q2.c does compile, it outputs junk. CourseNana.COM

To help you check whether your program is working correctly, there is a script called run_tests.sh which will run the program against all of the tests in the tests directory and report the results. It will also add the output from your program into the tests directory; comparing your output against the expected output might help you to debug your code. You can run the testing script as: CourseNana.COM

$ sh run_tests.sh

Once your program is working (passes all tests), follow the submission instructions below. If your program passes some tests, then you will receive some marks. If your program does not compile, or if you simply submit the supplied code (even with trivial changes), then your "answer" is worth zero marks. CourseNana.COM

Submission Instructions: CourseNana.COM

  • Type your answer to this question into the file called q2.c
  • Submit via:   give cs9315 exam_q2 q2.c 
    or via: Webcms3 > exams > Final Exam > Q2 submission > Make Submission
End of Question

Get the Solution to This Question

WeChat WeChat
Whatsapp WhatsApp
COMP9315代写,Database Implementation代写, The University of New South Wales.代写,COMP9315代编,Database Implementation代编, The University of New South Wales.代编,COMP9315代考,Database Implementation代考, The University of New South Wales.代考,COMP9315help,Database Implementationhelp, The University of New South Wales.help,COMP9315作业代写,Database Implementation作业代写, The University of New South Wales.作业代写,COMP9315编程代写,Database Implementation编程代写, The University of New South Wales.编程代写,COMP9315programming help,Database Implementationprogramming help, The University of New South Wales.programming help,COMP9315assignment help,Database Implementationassignment help, The University of New South Wales.assignment help,COMP9315solution,Database Implementationsolution, The University of New South Wales.solution,