COMP 206: Introduction to Software SystemsAssignment 4: files and pointersWinter 2024Before you start, please read the following on clarity and readability of the code. Do not do anything unnecessarily generalized, abstract, or complex, when simple, straightforward code suffices.• Your code must runYour code must run as-is and nearly instantly. TAs WILL NOT modify your code in any way to make it work.• Please read through the entire assignment before you start working on itYou can lose up to 3 points for not following the instructions in addition to the points lost per questions.1 A CSV-backed database written in CIn this assignment, your task will be to implement a command-line program called igdb in C for managing a persistent database stored as a CSV file. This is a simplified example of what C is actually used for in practice: writing fast, low-level data management software. The popular, high-performance, open-source relational database management system PostgreSQL代 写COMP 206: Introduction to Software Systems Assignment 4: files and pointers Winter 2024Java is written in C, for instance.Learning goals assessed:1. Write robust system interactions in C.2. Create custom data structures and algorithms in C.3. Organize code in C for readability.1.1 What’s in the database?The database in this assignment is for tracking Instagram accounts. One record in the database stores the following information.• Handle, e.g. @spottedmcgill• Follower count, e.g. 14900• Comment, e.g. a bit cringe tbh• Date last modified, e.g. 1710521259This record would be represented in CSV form as@spottedmcgill ,14900 ,a bit cringe tbh ,1710521259To accommodate the CSV file format, the characters '\0' (null) '\n' (line feed) and ',' (comma) are forbidden from appearing in the comment field.1.2 Representing dates and timesYou might have noticed that the “date last modified” above doesn’t look like a date at all...Representing dates and times robustly can be a challenge in software engineering. A very common and straight- forward solution is to represent an absolute moment in time in so-called UNIX Epoch format. This is thenumber of secondselapsedsincemidnighton 1 January 1970. These are also called (UNIX) timestamps. This format is independent of timezones, which makes it great for storage in a database. User-facing applications convert these timestamps into human-readable “local time” strings, accounting for timezomes, when displaying the time to a user.Your database will store UNIX timestamps, and your application must present these times in human-readable strings in the local timezone. The C standard library contains functions for working with UNIX timestamps and dates and times in general.• You will need to #include <time.h>• See man 2 time (get current timestamp)• See man 3 localtime (convert timestamp into time structure in current timezone)• See man 3 strftime (format time structure into string)1.3 Representing database records in CYou must define a struct Record to represent a single line (record) from the CSV file (database). It must have one member for each of the fields of the record described above.• The “handle” and “comment” fields must be character arrays (not pointers) with sizes 32 and 64 respectively.• The “follower count” and “date last modified” fields must be of type long unsigned int1.4 Representing the database itself in CYou must define a struct Database to represent a whole database. This will be an implementation of dynamic arrays, i.e. arrays that can “grow” during runtime, similar to the ArrayList class in Java or Python’s built-in list.A dynamic array has three attributes: a pointer to an underlying (fixed-size) array, an integer called the capacity, and an integer called the size. The capacity is the length of the underlying array, and the size is the count of elements actually stored inside that array.When we want to add an item to the end of a dynamic array, we WX:codehelp instructions:• Individual assignmentThis is All of your solutions should be composed of commands that are executable in mimi.cs.mcgill.ca.• Must be completed with vimA goal of the class is to get you to be comfortable in a command-line text editor. This wouldn’t happen just from knowing the vim commands from slides: You become comfortable by using it a lot. Assignments are a good opportunity for that.• You must use commands from classIn this assignment, anything in the C standard library is allowed. However, the emphasis in the assessment is an individual assignment. Collaboration with your peers is permitted (and encouraged!) provided that no code is shared; discuss the ideas.• Use Discord and OH for questionsIf you have questions, check if they were answered in the #clarifications or #q-and-a channels on Discord. If there is no answer, post your question on the forum. Donotpost your code. If your question cannot be answered without sharing significant amounts of code, please use the TA/Instructors office hours. Do not email the TAs and Instructors with assignment questions. TAs