Question: C++ Coding Assignment Implement a line editor with a linked list. Include your code that implements a linked list. Include your code for the line

C++ Coding Assignment

Implement a line editor with a linked list. Include your code that implements a linked list. Include your code for the line editor. Edit the main method to invoke your line editor implementation. Use std::cin statements to read in the test cases.

Sample Input 1:

insertEnd "now is the time" insertEnd "for all good men" insertEnd "to come to the aid of their country" print search "come to the aid" quit

Sample Output 1:

1 now is the time 2 for all good men 3 to come to the aid of their country 3 to come to the aid of their country

Sample Input 2:

insertEnd "now is the time" insertEnd "for all good men" insertEnd "to come to the aid of their country" print edit 2 "for all good people" print quit

Sample Output 2:

1 now is the time 2 for all good men 3 to come to the aid of their country 1 now is the time 2 for all good people 3 to come to the aid of their country

Sample Input 3:

insertEnd "now is the time" insertEnd "for all good people" insertEnd "to come to the aid of their country" delete 2 print insert 2 "for all good people" print quit

Sample Output 3:

1 now is the time 2 to come to the aid of their country 1 now is the time 2 for all good people 3 to come to the aid of their country

Sample Input 4:

insertEnd "hello world" insertEnd "how are you doing" insertEnd "hello world" search "hello world" quit

Sample Output 4:

1 hello world 3 hello world

Sample Input 5:

insertEnd "hello world" insertEnd "how are you doing" insertEnd "hello world" search "hello pluto" print quit

Sample Output 5:

not found 1 hello world 2 how are you doing 3 hello world

Sample Input 6:

insertEnd "hello world" insertEnd "how are you doing" insert 2 "hello pluto" print delete 3 print quit

Sample Output 6:

1 hello world 2 hello pluto 3 how are you doing 1 hello world 2 hello pluto

Sample Input 7:

insertEnd "now is the time" insertEnd "for all good men" insertEnd "to come to the aid of their country" delete 4 print insert 4 "Patrick Henry or Charles Weller?" print insert 6 "it was neither" print quit

Sample Output 7:

1 now is the time 2 for all good men 3 to come to the aid of their country 1 now is the time 2 for all good men 3 to come to the aid of their country 4 Patrick Henry or Charles Weller? 1 now is the time 2 for all good men 3 to come to the aid of their country 4 Patrick Henry or Charles Weller?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!