Write a C++ program that prompts the user with the following menu options:

R[everse-String] M[atrix] Q[uit]

1) If the user selects "R" or r then call a user-defined function void rev_str (void) that

a) Prompts the user to enter a string and store it into a one-dimensional array called Input_String [].
b) Replace the content of the original string with the string reversed and save into another array called Output_String [].
b) Print both the original string and reversed string in function rev_str (void).

2) If the user selects "M" or m then the program should display the following sub-menu for Matrix and implement the followings:

A[verage] F[requency] [Media]N P[revious Menu]

a) Prompt the user to enter five integer sets of four numbers and store the numbers in a 5 x 4 array called Data[5][4].
b) If the user selects "A or a" then your program should pass the array Data[ ][ ] from main ( ) to a function double Mean (const int Data [ ][ ], int, int ) that receives the array Data [ ][ ] and its dimensions as arguments to find the average for each row and column of array Data and prints the results in function main ( ).
c) If the user selects F or f then your program should pass the array Data[ ][ ] from main ( ) to a function void frequency (int const Data [ ][ ], int, int ) that receives the array Data [ ][ ] and its dimensions as arguments and counts the number of responses (frequency) of each number, then pints the frequency along with its histogram as follows:

Response Frequency Histogram
1 1 *
2 3 ***
3 4 ****

d) If the user selects "N or n" for median, then you program should determine the median by calling function void Median (const int Data [ ][ ], int, int) a user defined function to sort array of responses into a single-dimensional array in ascending order, and picking the middle element of the sorted array. In this function you should call a user-defined function called PrintArray ( ) to print the sorted array along with the median.

3) If the user enters "Q" or q then you should verify that the user wants to terminate the program before actually terminating the program.

4) If the user enters, any other selection it should prompts the user invalid selection and allows the user to try again.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.