Site icon Tutor Bin

Tarrant County College District C++ Worksheet

Tarrant County College District C++ Worksheet

Description

  1. Load the attached code into a project. Both files will be need to be modified and submitted for this assignment.
  2. Compile the existing code as-is. The LinkedList.h file should be in the header section of the Solution Explorer.
  3. Test Step – In the Driver13_3.cpp file
    1. Display “*** Test Step 3 ****”
    2. Use the insertNode() method to load 5 unique the integers to the linked list.
    3. Display the the contents of the linked list.
      1. The displayed results are expected to be in ascending order but can be inserted in any order.
  4. Modify the insertNode() method
    1. Add a boolean parameter to indicate only unique inserts are allowed. This parameter should have a default value of false.
    2. Change the return type of this method to be a bool. It should return false when (a duplicate already exists and the parameter is true) or return true when an insert occurs.
      1. Do not do a “pre-search” for this value. Follow the insert code but stop the insert if a match is found.
  5. In the Driver13_3.cpp file,
    1. Display “*** Test 5 ****”
    2. Use the insertNode() method and pass it a unique number and include the 2nd parameter of true.
    3. Use the insertNode() method and pass it a number already given and include the 2nd parameter of false.
    4. Display the contents of the linked list. The number from Step 5C should be displayed twice.
  6. Create a clear() method in the LinkList template.
    1. This method should remove all the entries in the linked list.
    2. It should set the head to nullptr.
    3. Comment this method in way similar to existing methods.
    4. Modify the destructor to call this method in lieu of it’s own code.
      1. The class destructor should still display “Linked List Destructor has completed.”
  7. Modify the deleteNode() method.
    1. Change this method to return a bool to indicate that a delete was done (true) or not done (false).
    2. Change the method to correctly return the expected result.
  8. In the Driver13_3.cpp file
    1. Display “*** Test 8 ****”
    2. Call the linked list clear() method
    3. Use the insertNode() method to load the integers 101, 202,303,404,505 to the linked list
    4. Use the deleteNode() method to delete number 101. Report if successful.
    5. Use the deleteNode() method to delete number 998. Report if successful.
  9. Allow the code to end normally. It should report “exited with code 0” in the console window as usual (No special code for this).
    1. The provided code should display “Linked List Destructor has completed.” per the LinkedList destructor.
  10. Complete all TODO items in the Driver13_3.cpp program and remove the TODO indicators once completed.

Deliverables include the modified Driver13_3.cpp, the modified LinkedList.h and a Screen Shot of the generated results. Content may be zipped.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version