Question: / / / = = = = = = = = = = = = PART 1 : FIXED code = = = = =
PART : FIXED code
DON'T CHANGE THIS PART
#include
#include
#define MAXWORDCHAR
#define GPA "GPA"
#define DATE "DATE"
struct Date
int year;
int month;
int day;
;
typedef struct Date Date;
struct Node
Date dob;
float gpa;
struct Node next;
;
typedef struct Node Node;
void readDataFILE char float Node Node ;
Node mergeListNode Node ;
Node filterListNode char float;
Node reverseListNode ;
void printListNode ;
int main
FILE fp fopenDATAINr;
Node headL NULL;
Node headL NULL;
char controlString;
float targetGPA;
readDatafp &controlString, &targetGPA, &headL &headL;
printListheadL;
printf
;
printListheadL;
printf
;
Node head mergeListheadL headL;
head filterListhead controlString, targetGPA;
head reverseListhead;
printListhead;
fclosefp;
PART : Student works
Define supported functions here.
void readDataFILE fp char controlString float targetGPA Node headL Node headL
TODO: read data with file pointer fp:
LINE: controlString targetGPA
LT or GTfloat number
LINE: headL is the head of list
LINE: headL is the head of list
Node mergeListNode headL Node headL
TODO: add list into the end of list return the head of result list
Node filterListNode head char controlString float targetGPA
TODO: Filter the third list based on GPA criteria.
If controlString is LT filter the students with a GPA less than targetGPA.
If controlString is GT filter the students with a GPA greater than targetGPA.
return head of filtered list
Node reverseListNode head
TODO: reverse the list
return the new head
void printListNode head
TODO: print the linked list to stdout
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
