I truly don't understand what this assignment is asking, and this is it
design a simple linked list class with only two member functions and a default constructor:
void add(double x);
boolean isMember(double x);
LinkedList( );
The add function adds a new node containing x to the front (head) of the list, while the isMember function tests to see if the list contains a node with the value x. Test your linked list class by adding various numebrs to the list and then testing for membership.
and what i have is
#include <iostream>
using namespace std;
struct ListNode
{
double value;
ListNode *next;
};
int main()
{
ListNode *head;
// Create first node with 12.5--step 1
head = new ListNode; // Allocate new node
head->value = 12.5; // Store the value
head->next = NULL; // Signify end of list
// Create second node with 13.5—step 2
ListNode *secondPtr = new ListNode;
secondPtr->value = 13.5;
secondPtr->next = NULL; // Second node is end of list
head->next = secondPtr; // First node points to second
// Print the list.
cout << "First item is " << head->value << endl;
cout << "Second item is " << head->next->value << endl;
return 0;
}