Step 6


Let's see if that code that takes care of numNodes and classSum really worked.

Add the lines of code in PrintList() in linkedlist.c to print out the number of students in the class and the average class grade.

The last step is next! Step 7...


linux1[1]% gcc -Wall -ansi -c linkedlist.c linux1[2]% gcc lab12.o linkedlist.o linux1[3]% a.out data.txt Welcome to the last lab of the semester! :) First Name Last Name ID Grade -------------------- -------------------- ------------ ------- Ann Lewis 123 98% Joseph Eisenhower 212 82% Mary Jones 634 85% Mark Johnson 345 78% Justin Lewis 122 99% Jenny Garcia 121 87% Gary Watson 532 92% Jamie Casselman 621 100% Samantha Warrez 124 86% Bob Ramsey 141 64% Claire Dishon 161 76% Number of students in the class: 11 Average grade: 86.09% Please enter the id# to delete from the list: 141 Student was successfully deleted from class list. First Name Last Name ID Grade -------------------- -------------------- ------------ ------- Ann Lewis 123 98% Joseph Eisenhower 212 82% Mary Jones 634 85% Mark Johnson 345 78% Justin Lewis 122 99% Jenny Garcia 121 87% Gary Watson 532 92% Jamie Casselman 621 100% Samantha Warrez 124 86% Claire Dishon 161 76% Number of students in the class: 10 Average grade: 88.30% linux1[4]%