Question: Please use c++ to implement the mutiplyElements function in the given code and please include a main method with test cases of your choice: Given
Please use c++ to implement the mutiplyElements function in the given code and please include a main method with test cases of your choice:
Given Code:
#include
using namespace std;
class node
{
int value;
node* next;
public:
//Given Constructor
node(int value, node* next)
{
this->value = value;
this->next = next;
}
//Implement the following method.
//This method multiplies each element in the list by k.
// and prints the answers to the console.
void multiplyElements(int k)
{
}
};
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
