Question: Assignment Description:? ?In this assignment, you will build a program that reads student information from a file, populates each student as a record in a
Assignment Description:? ?In this assignment, you will build a program that reads student information from a file, populates each student as a record in a linked list, and has some code to read/report values from the linked list data structure.
Learning Objectives: ?This assignment connects to the following course goals: ? Course Goal #5: ?Improve problem-solving and programming competency by building ever complex programs, specifically through analyzing, designing, implementing, testing and debugging C programs using various data types, loops, branches, arrays, and structs. ? Course Goal #6:? Write programs that manage memory using dynamic memory allocation functions and variables that contain a memory address (pointers). Apply these skills to allocate memory at run-time, and to (a) increase performance by passing addresses to functions instead of copying data, and (b) return more than one value from a function.
Starter Code: ?You should use this starter code posted on Blackboard to begin this assignment. Test cases are included in the starter code. The starter code is designed to run with a single command line argument that corresponds to the test file. If the file is not in the same directory, you will get an error message that the file is not found.
Implement the following functions (found in the starter code): ? Student *makeStudent(char name[16], int age, double gpa); ? void push(Student *student); ? Student *findTopStudent(); ? float getAvergeGPA();
Each function should perform the following tasks ? makeStudent: ?Given the student values, initialize a structure, and return a pointer to the struct ? push:? Inserts an element into the linkedList ? findTopStudent: ?Traverses the linked list and returns the student with the best GPA ? getAverageGPA: ?Traverses the linked list and returns the average GPA across all students ? main:? Change the main appropriately to call each function and obtain the desired results.
Be Careful!? ? We will check that your code follows these assignment rules: ? Do not hardcode an array of structures for this assignment. The purpose of the assignment is to learn how to manipulate memory dynamically. ? The data must be stored as a linked list. Do not just read the file and calculate the results while you are reading in the values. Once again, this is to ensure that you are learning how to manipulate memory. ? For this assignment, do not change the function prototypes to get your code to work.
Test Cases: ? If you implemented your assignment correctly, you should get the following results. Make sure that you are not avoiding the conditions above when testing your assignment. We will be checking your code and ensure that it is following those rules when grading. Test Case #1 (data1.txt): 
Test Case #2 (data2.txt): 
Test Case #3 (data3.txt): 
Starter code below:
| Starter Code | #include |
| data1.txt | Mary 23 3.5 Jane 34 3.6 Mark 23 3.3 Joe 23 2.5 Bill 23 1.3 Sam 23 2.1 Rebecca 23 3.9 Lowie 23 2.8 Will 23 3.1 John 23 2.2 Bonnie 23 3.2 |
| data2.txt | Mary 21 2.5 Jane 32 3.4 Mark 23 3.2 Joe 32 2.5 Bill 23 1.3 Sam 12 2.1 Rebecca 19 2.1 Lowie 18 2.8 Will 18 3.1 John 22 2.2 Bonnie 21 3.2 Gary 18 3.4 Billy 19 1.5 Steve 17 3.7 Jen 18 2.1 Bob 21 3.4 |
| data3.txt | Mary 21 2.5 Jane 32 3.5 Bill 23 1.3 Steve 17 1.5 Jen 18 2.1 Bob 21 3.4 |
user@a5c9a08fcd15:/projects/Hw4$ ./hw4 datal.txt The Student with the best GPA is: Rebecca The average GPA is: 2.86 user@a5c9a08fcd15:/projects/HW4$
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
