Question: C + + #include AnyList.h #include using namespace std; / / Write the definition of the function replaceData ( ) as a member /
C
#include "AnyList.h
#include
using namespace std;
Write the definition of the function replaceData as a member
function of the class AnyList as follows :
Parameters: An int storing the data to replace and an int storing
the replacement.
The function replaces an element in the list with the new element
passed as the second parameter.
If the element is not found, the function prints the message:
"Element is not in the list."
Example :
Calling object:
Parameters:
After replacing with
Calling object:
Assumptions :
There is at least one element in the list.
The are no duplicates.
Definition function replaceData
Your code here...
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
