1. Homepage
  2. Exam
  3. [2022] COMP9315 DBMS Implementation 22T1 - Final Exam - Q1 Tuples Count

[2022] COMP9315 DBMS Implementation 22T1 - Final Exam - Q1 Tuples Count

This question has been solved
Engage in a Conversation

Question 1 (15 marks)

The q1 directory contains an incomplete program q1.c. You must complete this program so that it counts the number of tuples 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

$ ./q1 data/Data1
20
$

"No-frills" files have at least one page of data, and all pages must contain PAGESIZE bytes. If the supplied file does not meet these criteria, then return the tuple count as -1. Otherwise, return the number of tuples that your program computed. Note that a "no-frills" file can consist of a single page of PAGESIZE bytes, all of which are '\0'; such a file should return a tuple count of 0. CourseNana.COM

Note that q1.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 the supplied q1.c does not compile; you will need to make changes before you can compile and execute it. 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 q1.c
  • Submit via:   give cs9315 exam_q1 q1.c 
    or via: Webcms3 > exams > Final Exam > Q1 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,