For this problem, you are to use the functions which you wrote for Problem Set II: Length(), Pos(), Delete(), Insert() and Copy().
Include all of the following features in a single program.
Your program will have the following structure. You are to turn in a completed hierarchical structure diagram for your program. Include parameter information in your diagram.
main
|
----------------------
| |
initialize menu
|
-----------------------------------------------------------------
| | | | | |
deletestring insertstring replacestring findstring upcasestring lenstring
|
GetValidInteger
The following will be your example run -- inputs are given in red. N.B. ^ indicates a space in the input.
Current Str: I love the Buffalo Bill legend.
0123456789012345678901234567890
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: f
Find what string? Bill
Bill was found at position 19.
Current Str: I love the Buffalo Bill legend.
0123456789012345678901234567890
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: R
Replace what string? I
With what string? We
Current Str: We love the Buffalo Bill legend.
01234567890123456789012345678901
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: i
Insert what string? all^
Where? 3
Current Str: We all love the Buffalo Bill legend.
012345678901234567890123456789012345
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: u
Upcase what string? Buffalo
Current Str: We all love the BUFFALO Bill legend.
012345678901234567890123456789012345
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: i
Insert what string? Doug Flutie,^
Where? 12
Current Str: We all love Doug Flutie, the BUFFALO Bill legend.
0123456789012345678901234567890123456789012345678
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: D
Delete what string? ^legend
Current Str: We all love Doug Flutie, the BUFFALO Bill.
012345678901234567890123456789012345678901
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: L
The current string is 42 characters long.
Current Str: We all love Doug Flutie, the BUFFALO Bill.
012345678901234567890123456789012345678901
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: I
Insert what string? ^quarterback
Where? 41
Current Str: We all love Doug Flutie, the BUFFALO Bill quarterback.
012345678901234567890123456789012345678901234567890123
Enter (D)elete, (I)nsert, (R)eplace, (U)pcase, (F)ind, (L)ength, (Q)uit: q