Test these procedures by writing a text editor and performing several editing operations. The editor should be driven by the following menu:
Enter the first letter of an edit operation described as follows:
D - Delete a substring
E - Enter a source string to be edited
I - Insert a substring
L - Locate a substring
P - Print the source string
R - Replace one substring with another
S - Show the menu
Q - Quit
A sample run of the program is given here to clarify how the program should behave:
%a.out
Text Editor Program
You will be able to edit text by choosing from the
following list of commands:
Enter
D to delete a substring from the source
string
E to enter a source string to be edited
I to insert a substring in the source
string
at a specified
position
L to locate the position of a substring
in the
source
string
P to print the source string
R to replace one substring with another
S to show this menu
Q to quit
What is your choice?
e
Enter string
This*is*a*string.
What is your choice?
d
Enter string to be deleted
is
What is your choice?
p
Th*is*a*string.
What is your choice?
l
Enter string to locate
*is
What is your choice?
i
Enter string to be inserted
at
What is your choice?
p
That*is*a*string.
What is your choice?
r
Enter old string
is
Enter new string
is*not
What is your choice?
p
That*is*not*a*string.
What is your choice?
d
Enter string to be deleted
thing
string not found
What is your choice?
p
That*is*not*a*string.
What is your choice?
i
Enter string to be inserted
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Can't insert; string would exceed 80 characters
What is your choice?
i
Enter string to be inserted
+++
What is your choice?
p
Th+++at*is*a*string.
What is your choice?
q
CHARACTER (80) :: stringand all changes to the string will be implemented using the string subprograms defined in Chapter 11.
/cs/bin/turnin submit cs1001 hw6 hw6.f90 hw6.script