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: 45,89,12,64
// Parameters: 89,100
// After replacing 89 with 100...
// Calling object: 45,100,12,64
//
// 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!