Starting from:

$30

CSC415-Buffer & structure Solved

. You will see a large number of #define statments the represent different computer lanaguages. Then there is a stucture called personalInfo. This is the structure you will allocate and populate. Next there is a #define of BLOCK_SIZE set to 256 this is going to be your buffer size to transform byte data into block data. Finally there are the prototypes for 4 functions that you will need and are described in the steps below. Note that the functions are implemented in provided assignment2.o file, you do not implement the

 Step four is to allocate (using malloc) an instantiation of the personInfo structure and to populate it. The firstName and the lastName are populated from the 1st and second command line argument. You will then assign your student ID to the studentID field, you will populate the level (gradelevel) appropriately. You will then populate the languages field. To do so, specify every language you have Knowledge of and there must be at least three (by definition, with the prerequisites for the course you should at least know some Java, C++, some assembler and of course now C. But, include all you have knowledge of. The last part of populating the structure is to copy the third command line parameter to the message field. Do note the length of the message field.

 Step five is to "write" your personal information structure by calling writePersonalInfo which is one of the function prototypes in the assignment2.h file. The return value from the function is 0 if it succeeds.

 Step six involves getting a series of C stings (you do not know how many or how long each one it or what it contains). You get these strings by calling the function getNext. The return value is a char * (C string). If the return value is NULL then you have finished. You will copy the contents of each of those strings into a buffer (block) that is BLOCKSIZE (use malloc to allocate the buffer), as the buffer is filled you will commit the buffer by calling commitBlock passing in the pointer to your BLOCKSIZE buffer.

 Step seven if the final coding step. Call the function checkIt, then exit main returning the same value as returned from checkIt.

 Step eight is dependent on checkIt running correctly and displays some binary data which is the personalInfo structure. You are to describe what each element is, use the structure as reference and show the values and how to read those values. i.e. which bytes are the student ID, what is it's hexadecimal value and if that is converted to decimal is it correct?

 Do a writeup in PDF format that includes a description of what you did and the compilation and execution output from your program and an analysis of the output as specified in step eight.

 Your main program filenames should be <lastname>_<firstname>HW<#>_<optional>.<proper extension>

 Rubric

 Grade Item
Grade Points
Standard Header
2
Command Arguments
5
Proper use of malloc and free
10
Proper population of personalInfo
10
Proper buffering
20
Proper use of KNOWLEDGE #defines
5
Correct Output
5
Code Comments
5
Writeup
8 (Description, Compilation, Sample Output)
Writeup analysis
10
 Sample Output:
 This output is just what is printed from checkIt You can also print out the structure and information prior to calling checkIt. (Some of the data below has been altered, so your output will be different

More products