Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ program that prompts the user with the following menu options: R[ everse-String] M[ atrix] Q[ uit] If the user selects R or r then
C++ program that prompts the user with the following menu options:
R[everse-String] M[atrix] Q[uit]
- If the user selects "R" or "r" then call a user-defined function void rev_str (void) that
- Prompts the user to enter a string and store it into a one-dimensional array called Input_String [].
- Replace the content of the original string with the string reversed and save into another array called Output_String [].
- Print both the original string and reversed string in function rev_str (void).
- 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] P[revious Menu]
- 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].
- 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 of the numbers in the array and prints the results in function main ( ).
- 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 ****
- If the user enters "Q" or "q" then you should verify that the user wants to terminate the program before actually terminating the program.
- 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