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).

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

Head HeadEven HeadOdd 1 2 5 8 0 0 0 0 0

Head HeadEven HeadOdd 1 2 5 8 0 0 0 0 0 0

Step by Step Solution

3.40 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include include include using namespace std Node structure for the doubly linked list struct Node in... View full answer

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!