// This a sample lab test #5. // You are to add three new methods to the List class, found on the G: drive. // Information on the methods to add can be found below. // Your methods must work under all circumstances (feel free to add more test cases). // The third method (which is a bonus 5 marks) *must* be recursive. // Submit files List.h and List.cpp. #include "stdstuff.h" #include "List.h" int main () { List list, list2, list3, list4; int i; for (i = 0; i < 15; i++) { list.insert ((i * i) - (8 * i) + 2); } list3=list; list4=list; list.outputList (); // Method "countMoreThan" returns the number of values in the list that are greater than // the given value (here 10). If the list contains no values greater than the given value, it returns 0. // You are to add this method to class "List" (see above). // Note that your method should work properly in all circumstances, not just for this // particular list and value. Your method can be iterative or recursive. cout << "\nthe number of values in the list that are more than 10 is: " << list.countMoreThan(10)<< "\n\n"; // Method "duplicateOdds" duplicates all values in the list that are odd. This refers to the contents // of the node, not its position in the list. If the list contains no odd values, the method has no effect. // You are to add this method to class "List" (see above). // Note that your method should work properly in all circumstances, not just for this // particular list. Your method can be iterative or recursive. list.duplicateOdds (); cout << "after duplicating every odd value the list is:\n"; list.outputList (); // Method "isEqualTo" returns true if the two lists are equal, false otherwise. // Two lists are equal if they contain the same values in the same order. // You are to add this method to class "List" (see above). // Note that your method should work properly in all circumstances, not just for these // particular lists. Your method **must** be recursive. Iterative solutions get 0. if(list.isEqualTo(list2)) cout << "\nINCORRECT: list and list2 are equal.\n"; else cout << "\nCORRECT: list and list2 are not equal.\n"; if(list4.isEqualTo(list3)) cout << "\nCORRECT: list4 and list3 are equal.\n\n"; else cout << "\nINCORRECT: list4 and list3 are not equal.\n\n"; pause(); return 0; }