// This is version 1 of lab test #3 for lab section D1. // You are to add two new methods to the List class, found on the G: drive. // Information on the methods to add can be found below. // Submit files List.h and List.cpp using the submit program provided. #include "stdstuff.h" #include "List.h" void realMain () { List list; for (int i = 0; i < 15; i++) { list.insert ((i * i) - (8 * i) + 3); } list.outputList (); // Method "countOddValues" returns the number of nodes in the list containing odd values. // Note that "containing" refers to the *contents* of the node, not its position in the list. // If the list contains no odd values, it returns 0. // You are to add this method to class "List". // Note that your method should work properly in all circumstances, not just for this // particular list. (Feel free to add additional test cases.) cout << "\nThe number of odd values in the list is: " << list.countOddValues() << "\n\n"; // Method "deleteValuesMultThree" deletes every node containing // a value that is an exact multiple of 3 (i.e. ..., -9, -6, -3, 0, 3, 6, ...). // If the list contains no values that are multiples of 3, it has no effect. // You are to add this method to class "List". // Note that your method should work properly in all circumstances, not just for this // particular list. (Feel free to add additional test cases.) list.deleteValuesMultThree(); cout << "After deleting the values that are multiples of three, "; list.outputList (); cout << "\n"; } int main () { try { realMain (); } catch (exception &e) { cout << "Exception occurred " << e.what() << endl; } pause(); return 0; }