Question: Write a program that starts with an empty line of text, and accepts the following commands: L: moves cursor to the left; R: moves cursor

Write a program that starts with an empty line of text, and accepts the following
commands:
L: moves cursor to the left;
R: moves cursor to the right;
I s: inserts the string s at the current position;
D: deletes the character at the current position;
C c: changes the character at the current position to the character c;
U: changes all characters to the upper case equivalent (use apply);
l: changes all characters to the lower case equivalent (use apply);
P: prints the current content of the line and the cursor position;
Q: quits the program.
For simplicity, you may assume that the character c and the string s in the
commands above do not have whitespace characters. Use the underscore (_)
instead if you wish to use a space. Write your program in prob1.cc.

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!