CST8234 – C Programming XXXXXXXXXXAssignment #2 (10% weightage) Note: Students must demonstrate their lab to get the grade. This assignment is worth 40marks and you must work within the same group as...

1 answer below »


CST8234 – C Programming XXXXXXXXXXAssignment #2 (10% weightage)

Note: Students must demonstrate their lab to get the grade. This assignment is worth 40marks and
you must work within the same group as you’d functioned for A1. A Missed demonstration
will result in 100% grade deduction. Late submission is not allowed. You must talk to me in
advance in case of any unprecedented situation which may result in late submission.

Employee Database Implementation
Problem Statement Specifications:
This assignment will be to implement a program to maintain an employee database, with each
employee represented by his/her name, gender, age and job description. You are provided with the
structure to be used to represent the information for each employee. Your task will be to build the
lower level functions that build and manipulate the database using a single linked list.
You will represent the employee database as a list of nodes inside your self-referential structure,
one per employee, each containing the relevant name, gender, age and job description for the
employee. The struct Employee declaration is as follows:

#define MAX_NAME_LENGTH 100
#define MAX_JOB_LENGTH 100

* Employee structure*/

struct Employee
{

* Employee details */

* pointers to next employee structures in the linked list*/

struct Employee *next;
};


Representing Employee Database using LL
In your program you will manipulate struct Employee structures to construct and alter the database.
Now, set the maximum number of employees in our database dynamically. Allow at least 150
employees. Here is a simple program using dynamic memory allocation.
#include
#include
#include
int main ( int argc, char *argv[] )
{
char *string;
int length = 200;
string = (char *) malloc(length);
strcpy ( string, "This is a string that fits easily into 200 bytes" );

CST8234 – C Programming XXXXXXXXXXAssignment #2 (10% weightage)

printf ( "String: %s\n", string );
free ( string );
eturn 0;
}

Your linked list should look like this:

Note:

In order to successfully complete this program and obtain all the marks, you will need to implement
ALL the requirements, explicit and implicit:

1) When submitting the files, you MUST follow the name specification as described.

2) If either the name or job description is longer than the specified maximum length, it should be
truncated. That said, allow a maximum of 20 chars.

3) Make sure memory used to declare the a
ay size doesn’t get WASTED, specifically, in case when
the database has insufficient memory to hold the data of the employees.

4) Your database must not be inefficient in implementing important operations, especially as the
elements of the a
ay are maintained in a specific order (say names are stored in alphabetical
order). If 2 employee names are the same, then sort them based on their
age/gende
profession. That said, expect to delete the employee node using any of the features
(name/age/gender) used to describe the employee.

5) You must distribute your functions in a meaningful manner across .c and .h files. The .c files
should contain functions that represent sensible groupings of functionality. You must define .h

CST8234 – C Programming XXXXXXXXXXAssignment #2 (10% weightage)

files as appropriate

6) Each function must have a header comments that explain what it does, and describe and/or
explain its inputs (if any) and return value (if any)

7) You must submit makefile, .c and .h files of your properly commented code.

8) Your program should present information to the user in clear way.

9) For more details, refer to the reference doc on BRS


Deliverables:
• Create a folder called algonquinUserID1_GroupNumber_A1 (e.g.,
“mynam00123_Group1_A1”) that represents all the members of your team (who’ve
collaborated) based on the groups created on BRS. Only one submission per group is
equired. You must submit your .c , .h and make files altogether ZIPPED (don’t submit
.RAR) in the assigned submission folder on BRS section 010 (activities -> Assignments).
Marking Scheme

Item Penalty
Coding co
ectness (functions’ structure) is substandard 3 marks
Inappropriate and Inefficient Logic 5 marks
Addition of employees to database is inco
ect 20 marks
Deletion of employees doesn’t work 10 marks
Missed demonstration 40 marks
Input validation is inacceptable 15 marks

Refer to the Ru
ic for more details.
    Problem Statement Specifications:

To implement a program to maintain an employee database:--
1. You're required to create an employee database as a list of nodes inside your self-referential
structure, one per employee, each containing the relevant attributes. After creation, you must
e able to add/insert new employees, modify existing data and/or delete existing data.
2. The below snippet gives an idea of the demonstration terminal on successful execution.
3. Insertion Option: You can have an employee with the same name but make sure to have at least
one different feature amongst the 2 employees with the same name, age and/or gender. You
must keep a count of the nodes every time you delete/add a new node.
4. Deletion Option: Expect to delete the employee node using any of the
features (name/age/gender) used to describe the employee.
5. In all the options, you must do the input validation. For instance, the user cannot input the
name of the employee when he's asked to search/delete a node using gende
age/profession
will be considered a penalty.
6. An option needs to be there to terminate the application (like 'q' in the below snippet)
7. During demonstration, you must create at least 5 employee nodes and based on priority, I'll
enter to your BR to let you demonstrate.
8. How to handle similar features of employees: Say that you're required to delete/modify the
employee using Gender 'Female'. Check the below snippet on how to proceed.


Answered Same DayApr 04, 2022

Solution

Nidhi answered on Apr 05 2022
14 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here