You are to write a program in C++ that handles strings.
Program Requirements:
Write a program that processes string information.
Write the functions shown below
All strings MUST be implemented by using arrays of characters. Do not use the string class in c++.
You may use array notation when using the array of pointers.
The program source code shall be written in procedural C. The code should have comments. The code should be easily readable and should have proper indentation.
The program shall compile with no errors or warnings.
Create the string functions listed below inside a separate cpp and header file. Invoke the string functions listed below from your main.
Detailed Design:
Function Design:
Note: Your functions should work for any size string entered. You should not have code that only works with the test data shown.
Function Name:GetInput
Inputs: Array of string pointers ( You may use array notation.)
Return: Nothing
Description: This function accepts three lines of user-input text and store the entered lines as three individual strings. Use a pointer array to store the strings. The function should ask the user to enter in three lines of data. The function will store the information in the pointer array. (cin.getline()). Should be allocated in inside GetInput and should be exactly the correct size for each string,
Function Name: Search
Inputs: The array of string pointers and the keyword string.
Return: Nothing
Description: The function will search for a "keyword". The function will begin searching for that text within your pointer array. If the string is found, it will print a message to the user indicating that the string was found. It will also print every string that the element was found in. It should also print the total number of lines of the string that were found.
If the element is not found, the function should print "String Not Found."
Function Name: Sort
Inputs: The array of string pointers.
Return: Nothing
Description: The function will sort the array of strings. The function will simply re-order the pointer elements such that the strings are ordered. The sort function should work with any size array passed in.
Function Name: DisplayStrings
Inputs: The array of string pointers.
Return: None.
Description: This function will print out each string in the string array. You may use array notation when using the array of pointers. Put a linefeed after each string so that one string is displayed per line.
Function Name: ShowLens
Inputs: The array of string pointers.
Return: None.
Description: This function will print out length of each string in the string array.
Function Name: AlphaChars
Inputs: The array of string pointers.
Return: int
Description: This function will Search through all of the the string elements in the array and return the total number of alphabetic {a-z,A-Z} characters found in each string. The return value should be the single total of all of the alpha chars in all three strings.
---
Program should be written to work with any length string. Do not hard code loops to only work with a specific string size.
Main Design:
1 Declare an array of string pointers. There should be three elements.
2 Get the user input by calling the GetInput function. You should enter in the following strings in this order exactly as written. Be sure to include the periods, spaces, capitalization, etc.
I love Pep9 more than bacon.
42 + 8 is not 1008.
A cat loves her owner.
3 Display the Strings.
4 Search for the string love by calling the function Search.
5 Sort the strings.
6 Display the strings by calling the function DisplayStrings .
7 Display the lens by calling the function ShowLens.
8 Print the total number of alphabetic characters by calling AlphaChars.
Use multiple files.