Question: C++ Write the definition of the function deleteElem() as a member function of the class AnyList as follows: - Parameter: An int storing an element
C++

Write the definition of the function deleteElem() as a member function of the class AnyList as follows: - Parameter: An int storing an element to delete. - The function searches for the value passed by the parameter and, if found, it deletes it. If the element is not found, the function prints the error message "Element \# is not in the list." where \# is replaced by the element. - The function traverses the list using a WHILE loop. To make your function efficient, make sure it stops when it finds the element--use a Boolean value.) - If the list is empty, the function prints the error message "The list is empty." - Assumption: All elements are unique. Make sure you do NOT write redundant code such as (found == true) or similar
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
