singly linked lists

Instructor note:

Submit this assignment here for grading, submit your report in Canvas (total 100 Points).

Review

  • singly-linked lists
  • building a multiple source/header files project
  • operator overloading

As an entry-level programmer you have to be able to read, understand existing code and update it (add new features). One of this assignment’s goals is to read about 400 lines of code in five files, compile and run the program, understand it, and change it as required.

Download and review the following files (read code and all comments carefully):

  • College.h
  • College.cpp
  • LinkedList.h
  • LinkedList.cpp
  • main.cpp

This program:

  • Reads data about colleges from a text file and inserts them into a sorted linked list. The list is to be sorted in ascending order by the college code (assume it is unique).
  • Displays the list as a table, including the number of colleges in the list.
  • Searches the list: prompts the user to enter a college code, searches for that code: if found, displays related data, otherwise displays an error message, then searches again for another code, until the user enter “Q” to stop searching.
  • Deletes nodes from the list: prompts the user to enter a college code, searches for that code: if found, it removes it from the list, otherwise displays error message, then searches again for another code, until the user enter “Q” to stop deleting.

Read and understand this program (draw UML diagrams, the linked list, and hierarchy charts). Then do the following:

  • In main.cpp: provide calling statements for the basic linked list functions
    • Build and run the program: search will not work, but display and delete should work
  • In LinkedList.cpp: finish writing the searchList() function
    • Build and run the program: now search should work too
  • In College.h and College.cpp overload the stream insertion operator. The overloaded operator is going to replace the hDisplay() function in the College class, and it is going to be used in LinkedList.cpp, in displayList() as shown below
    • Build and run the program
// Display the value in this node._x000D_
   pCur->college.hDdisplay();_x000D_
// new code_x000D_
   cout << pCur->college_x000D_