Question: Write a C program using the macro definitions and structure definitions as detailed below to store data for employees working at a department at a
Write a C program using the macro definitions and structure definitions as detailed below to store data for employees working at a department at a university and the courses offered by them. #define COURSENAMELENGTH 50 // #define COURSECODELENGTH 10 #define COURSESMAX 5 // #define DIPLOMAMAX 5 // typedef struct fullName{ // char *name; // char *surname; // }name_t; typedef struct dates{ // int day; // char* month; // short year; // }date_t; typedef struct diploma{ // char *facName; // char *deptName; // char *level; // date_t dateAwarded; // }diploma_t; typedef struct courseOffered{ // char courseName[COURSENAMELENGTH]; // char courseCode[COURSECODELENGTH]; // date_t startDate; // date_t endDate; // }course_t; typedef struct employeeInfo{ / name_t employeeName; // diploma_t dip[DIPLOMAMAX]; // course_t noCourses[COURSESMAX] // int age; // double salary; // date_t startDate; // date_t dateOfBirth; // }employee_t;
In your program perform functions to addEmployee(), addDiploma(), addCourse(), displayInstructorInfo() and displayCourseInfo(), printClass() and calculateCourseAverage(). Please remember that you are not allowed to use any global variables or file operations. All variables used must be local variables. I want to see how you pass parameters to functions.
Inside the main() function, along with other variables you need, use the variable employee_t allEmployees to both populate the employee data of the university, as well as to display them.
Please remember you will be graded based on how well you showcase your knowledge. Feel free to add any further functionality to your program provided the functionality, required and detailed above, is completely implemented and detailed. If a student cannot do everything in the program they can still do partial work and that will be graded provided they can explain and detail their work both schematically and verbally (in form of a document). Partial work will be partially graded.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
