Question: Hey everyone, if anyone could help me real quick with this question that'd be great! thanks :) C++ EVERYONE!!! will post mutliple times in order

Hey everyone, if anyone could help me real quick with this question that'd be great! thanks :) C++ EVERYONE!!! will post mutliple times in order to get full answers if need beHey everyone, if anyone could help me real quick with this question

that'd be great! thanks :) C++ EVERYONE!!! will post mutliple times in

Task Write a C++ program that implements a simple command-oriented text editor. The program reads commands from its standard input that modify the text of the document. When the program reaches end-of-file on its input, it writes the current contents of the document to standard output and exits Background In addition to the text of the document, the editor maintains a current position indicator, referred to as point, that defines the location for text-modifying commands. Conceptually, point is interpreted as specifying the location between characters rather than the characters themselves. Thus its smallest value specifies the location before the first character in the document, and its largest value specifies the location after the lastcharacter Some commands operate on whole lines. In such cases, the line containing point is the location of the action, and the contents of the line is considered to consist of all of the characters that make up the text (which could be nothing if the line is empty) plus an end-of-line indicator. The lowest value of point for a given line is the location before the first character, the highest value is after the last character but before the end-of-line indicator Input commands that begin with a dot define operations on the document, such as moving point inserting and deleting text, and searching. All other input defines text to be inserted as-is. For example the input of our discontent. move to beginning of document Now is the summer move to previous line SS ummer search for "summer 6d. delete 6 characters iwinter insert "winter" constructs the document Now is the winter of our discontent. Hints A central issue in your design will be the data structure you use to represent the document contents. Two aspects that you might like to consider are whether or not to explicitly represent lines of text as separate entities, and how to store the characters themselves. Representing lines explicitly would simplify the implementation of operations that work on whole lines but will make operations that span lines more difficult. Conversely, if the entire document is a single block of text then line-spanning operations would be simpler, but you would need to explicitly locate line breaks when performing whole-of-line operations. Possible choices for representing the character values include an array of characters, a vector or list of characters, or a string object. An array has minimal space overhead and is compatible ith standard c-string processing functions, but is less convenient and less efficient for insert and delete operations. A vector or list would simplify the insert and delete, but has memory overheads and depends on the STL iterator mechanisms. A string object is convenient but can only be manipulated through the string API

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!