1. Engineering
  2. Computer Science
  3. write a c program that includes the following define the...

Question: write a c program that includes the following define the...

Question details

Write a C++ program that includes the following Define the LinkedList class template in the header file LinkedList.h // LinkedList.h #ifndef LLH #define LLH - using namespace std; template <typename T> class LinkedList public: // Constructor LinkedList(); //Desctructor LinkedList); /I Makes the list to the empty state void make_empty(); // Returns the size of list int get_size() const; /I Check if item is in the list. bool find(T item) const; / Insert item at the front void insert front(T item); // Removes the element fron the front void remove front); // Removes the first element which matches item. (optional) void remove(T item); // Prints the list void print () const; private: struct NodeType T data; NodeType* next; 3: int size; I/ the size of the linked list NodeType* head; #end if

Please read the comments carefully and implement the LinkedList class template in the file LinkedList.cpp // LinkedList.cpp #include #include <iostream> LinkedListh template <typename T> LinkedList<T>: LinkedList) size 0; head NULL; // add other member functions The main function is contained in the file laba3.cpp // labe3.CPP #include <string> #include LinkedList . h #include LinkedList.cpp.. int main () The main function, 1. Declare a linked list which stores integers. 2. Prompty the user to enter int values and add these values in the int linked list, stop adding the values when the user enter 0 3. Prompty the user to enter k (the number of values to be removed), and remove k values from the front. 4. Print the values of stored in the linked list. 5. Declare a linked list which stores strings 6. Prompty the user to enter string values and add these values in the string linked list, stop adding the values when the user enter exit. 7. Prompty the user to enter k (the number of values to be removed), and remove k values from the front. 8. Print the values of stored in the linked list The expected result Create a list of integers: 10 20 30 40 50 60 70 80 90 e How many values you want to remove? 3 The list is: 60 50 40 30 20 10 Create a list of strings: Jim Tom Alice Bob Ellen Bella Smith Don exit How many values you want to remove? 3 The list is: Ellen Bob Alice Tom Jim

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution