Software Systems Final Project

$24.99 $18.99

Project Synopsis For your nal project, you will implement a software solution that consists of shell scripts and C program to compute the lab attendance associated with each student. Exercise 4 – GDB. (4 Points) This is a theoretical exercise. The response to this exercise must be turned in as gdb.txt as a combination of…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

Project Synopsis

For your nal project, you will implement a software solution that consists of shell scripts and C program to compute the lab attendance associated with each student.

Exercise 4 – GDB. (4 Points)

This is a theoretical exercise. The response to this exercise must be turned in as gdb.txt as a combination of textual explanation (of what you are doing and why) and gdb commands. Your responses must be based on your C program.

  1. Now imagine that your C program crashed (abort) while executing. You suspect that it is crashing inside the function generateAttendance. Describe what gdb commands (from compiling to executing the program) will you use, so that gdb will automatically stop execution at the beginning of the said function (using the most minimal steps to get to there).

  1. At this point, since you are not sure which part of the code is causing the issue, describe the sequence of commands that you will be executing. Continue the above investigation till you reach the part of your code where you are accessing the rst node of the linked list (as passed or accessed by the generateAttendance or its helper functions) for the rst time. Print the address pointed by that particular variable.

You may end the gdb session at this time. (We will imagine the issue was that somehow that pointer was NULL which your code was not handling correctly. But you do not have to modify your working code to make it crash.)

Exercise 5 – A Shell Script to Convert CSV to HTML (3 Points)

Now that we have the attendance information in the form of a CSV le, we can generate other interesting visual formats of this information. In this exercise, you will convert the CSV into an HTML format using Unix commands.

1. Write a shell script csv2html.sh that accepts two lenames as arguments.

$ csv2html.sh /data/attendance.csv /data/attendance.html

The rst argument is a CSV le in the format produced at the C program’s output that contains attendance information. The second argument is the lename for the output html version. The script should work ne with both absolute and relative paths.

  1. You MUST use only sed (additionally may use echo, if you need to) command to generate the output html contents. Violation of this will result in 0 points for this exercise.

  1. The conversion can be easily done, once you understand the simple structure of HTML. Below is an example format (truncated for brevity).

  • cat attendance.html

<TABLE>

<TR><TD>User Email</TD>…<TD>A</TD>…<TD>I</TD> <TD>Attendance (Percentage)</TD></TR>

<TR><TD>adeline.larsen@mail.mcgill.ca</TD>…<TD>62</TD>…<TD>77.78</TD></TR>

<TR><TD>melody.cohen@mail.mcgill.ca</TD>…<TD>65</TD>…<TD>88.89</TD></TR>

</TABLE>

Basically the entire contents is enclosed between the HTML tags <TABLE> and </TABLE>. Further, each row (line/record from CSV) is enclosed in <TR> and </TR> tags. Finally, each value themselves is enclosed between <TD> and </TD> tags.

If you copy the attendance.html le to your computer and open it in your computer’s browser, it will look something like this (truncated).

There might be some minor visual di erences based on your browser types and versions, but that is ok.

  1. If you want to experiment with HTML table tags, here is a resouce that can be helpful.

  1. There is no requirement for the shell script to perform any error checks, but it is once again recommended to include some to help you during development and debugging.

CHECKLIST: WHAT TO HAND IN

  • git.log

  • fixformat.sh

  • labapp.c zoomrecs.h zoomrecs.c makefile

  • gdb.txt

  • csv2html.sh

You may create an archive of the le to upload, if needed. If all of your code is in the directory FinalProj, you can archive them in the following manner.

$ tar -zcvf FinalProj.tar.gz FinalProj

Please download your submitted les to double check if they are good. Submissions that are corrupted cannot be unfortunately graded. Forgetting to submit required les will not get another chance.

You do not have to turn in the executables and object les associated with your C program. Any such les will be ignored and TAs will compile your C program on their own as indicated in the problem descriptions above.

ASSUMPTIONS

  • For the C program, you can assume that each line in the CSV can be easily read into a char array of size 200.

  • You can assume that the given C struct is su cent to store any values that you may see in the C program’s input.

  • You can assume that the names of the elds in the headers and their order remains the same and that no empty les will be used. All data will be ASCII (what we have seen so far in class) no Unicode, etc.

  • Alphabets in email ids follow lowercase letters and emails can additionally contain only period(.) and at sign (@).

  • You do not have to look for \bad data” in the attendance records.

  • You need not perform any explict error checks for the exercises other than those explicitly stated. However, your program must not crash/fail/error for valid inputs.

HINTS

You will nd that the shell scripting techniques learned for mini3 and the C programming logic that you implemented for mini5 can be used to make your project development e ort easier.

RESTRICTIONS

  1. None of your programs, scripts should not create any other intermediate (temporary use) les. They should only create the nal output le. Violating this can result in additional deductions for respective exercises.

  1. All of your scripts, programs should execute under a minute (in-total) for an estimate of 100 zoom records. (For some perspective, a naive implementation will execute under a couple of seconds).

  1. If your program crashes, goes into in nite loop, etc., TAs may not execute remaining test cases.

  1. Other individual restrictions are stated with each exercise. There is no further constraints.

TESTING

  • We recommend you start testing by creating only a couple of directories (say lab1, lab2) and a couple of les (say Lab-A, lab-C) and with just 1-2 students to begin with. Keep in mind that your objective should be about variety of data in testing and not necessarily its volume. For example if you test with 100 records that are already in sorted order, you may not realize that your C program’s sort logic is not working. If you plan smart, you can test e ectively with just a few records that you create.

  • Once you get a hang of it, you can try out more number of students. Remember! debugging your logic for corectness using a large amount of data will be very di cult.

  • TAs will test using their own scripts, but it will follow the assumptions that have been setforth in the project description.

QUESTIONS?

Please use piazza. However, before posting your question, use the search functionality to check if it has been already discussed. You should also look under \Final Project general clari cations” pinned post to check if a popular question has been already included there. They will not get individual responses again.

This is your nal project and you are expected to be able to debug your program’s logical errors and other issues using the tools and techniques taught in class. TAs will not help you do your nal project.

If your program crashes, use gdb to debug your program.

Responses are limited to clari cations on the project descriptions and expectations.

8

Software Systems Final Project
$24.99 $18.99