Logistics

  • Due: Wednesday, April 17th AoE.
  • Submission instructions: make sure that the required files are in your csci112_spring2024/classwork/week14/wed/ directory.
  • Deadline reminder: after the deadline passes, you cannot earn any points for this assignment.

Learning outcomes

  • Write a complex function for a linked list

Assignment

  • Log in to the server.
  • From your home directory, navigate to csci112_spring2024/classwork/week14/wed/, creating directories week14 and wed if necessary.
  • Copy the files main.c, team.c, and team.h from the /public/classwork/week14/wed/ directory into your directory.

You will only need to change team.c.

Note that these files are very similar to the Lab 11 files. In this classwork, you will implement the insert_person_at_back function, which is not included in Lab 11, but is included here for practice.

This function should find the last node in the list of Persons at team’s head and add a new Person at the end. Just like in class, make sure that you also account for the case where the list is empty.

After you have implemented insert_person_at_back, compiling and running your code should look like this:

[g73x595@csci112 wed]$ ls
main.c  team.c  team.h
[g73x595@csci112 wed]$ gcc main.c team.c -Wall
[g73x595@csci112 wed]$ ls
a.out  main.c  team.c  team.h
[g73x595@csci112 wed]$ ./a.out
  Enter person's name > Bob
  Enter person's name > Sally

Current team:
Bob->Sally->

Autograder

You can run the autograder by running

/public/classwork/week14/wed/autograder.sh

The file autograder.txt will be created with your score.

Grading turnaround

The autograder will be run at 6am to calculate final scores. Scores will be uploaded to D2L by the next class period.