Question
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
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 Print Array ( ) 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started