Write in C++ . OTHER CHEGG POSTS AREINCORRECT . Please don?t use malloc or convert string to
Question:
Write in C++. OTHER CHEGG POSTS AREINCORRECT. Please don?t use malloc or convert string to intusing at int data = atoi(line.c_str()); Don't usefree(temp). Add comments and Output snippets. will down voteif COPIED other posts. PLEASE NEED HELP ASAP WILL UP VOTE!
Read in a file of supposedly positive integers (>0) from?integer.dat? (perform file validation ? e.g. file exists,empty file, etc.) create a doubly linked list ofintegers, adding values in descending sort order ? printout any error messages to the screen and to a file ?errorlog.txt?if the integer is
In addition, include as part of the list a doubly linked?sub-list? of only even integer numbers and only odd integernumbers. This means that there is a minimum ofFOUR pointers for each node in the list ?forward/backward full list, forward/backward even or oddlist.
Write one function to print the entire list,even number list, and odd numberlist in either ascending or descendingorder. Use input parameter with value ?A? (ascending) or?D? (descending) to tell which direction to print.
The main program, after reading in from the file,will also allow the user to add (remember must be >0) ordelete integers from the list.
In all cases (both from file and from user),notify the user with an error message when: number to add is already in thelist number to delete is not in the list
Have appropriate welcome and ending messages print to the screen,but NOT to the log file.
Sample node has data, prev, next, prevEvenOdd, nextEvenOdd