Using C++ Write a program using the list STL that will act as a line text editor
ID: 3816391 • Letter: U
Question
Using C++
Write a program using the list STL that will act as a line text editor. The program will have the following features: a. Functions to insert, remove and empty the list. b. Function to display all current lines (special case if the editor is empty) c. Function to swap two lines (Assuming they exist) d. Function (Non-member) to display a menu with all these operations Test your program with the following procedures: 1. Add 1 line, delete 1^st line, delete 3^rd line, display list. 2. Add 4 lines, delete 3^rd, delete, delete 1^st, display list. 3. Delete list, display list. 4. Add 6 lines, delete 1 line, display list.Explanation / Answer
#include #include #include #include using namespace std; int main() { int myints[] = {5, 6, 3, 2, 7}; list l, l1 (myints, myints + sizeof(myints) / sizeof(int)); list::iterator it; int choice, item; while (1) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.