Question: PROGRAM SHOULD BE IN C++ .The purpose of this program is to ask the user to input a string into a C-string (i.e. a character

PROGRAM SHOULD BE IN C++ .The purpose of this program is to ask the user to input a string into a C-string (i.e. a character array) using the cin.getline function (see section 10.3 of Chapter 10, this will allow you to also include spaces in the input stream). Then, a function reverseStr will accept the character array as an argument, and return the content backwards in the same array (remember arrays are passed by reference in C++). Do NOT use pointers to solve this problem. So for example, if the user input Hello World!, the program should call the function reverseStr as below: const int SIZE = 81; char inputLine [SIZE]; cin.getline (inputLine, SIZE); // User input Hello World! reverseStr (inputLine); // The inputLine is now !dlroW olleH The input character string should be no more than 81 characters (see above) to allow the user to input a long input string (e.g. Hello, my name is Ben Franklin.). The main function code must use the following: // Global Constants const int MAX_STRINGLEN = 81; // Function prototypes void printProgramPurpose (); void reverseStr (char inputString []); void printProgrammerName (); int main() { char inputString[MAX_STRINGLEN]; // To hold the C-string // Print the welcome message for the user printProgramPurpose (); // Get a string from the user. cout << "Enter a string of " << MAX_STRINGLEN; cout << " or fewer characters: "; cin.getline(inputString, MAX_STRINGLEN); // Reverse the string reverseStr(inputString); cout << " Reversed: " << inputString << endl; cout << endl << endl; // Print Programmer Name printProgrammerName (); return 0; } Your job is to complete the program and write the functions listed in the function prototype list: // Function prototypes void printProgramPurpose (); void reverseStr (char inputString []); void printProgrammerName (); Remember: Include several test runs of the program to show successful runs of your program, with both valid and invalid data (to show that you are checking for invalid data) Please ensure the program is well designed and follows accepted style guidelines (e.g. variable naming, indentation, spacing). Please ensure the program is well documented, including the overall purpose of the program and documenting all the major sections of the code.

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!