Answered step by step
Verified Expert Solution
Link Copied!

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
    1. Prompts the user to enter a string and store it into a one-dimensional array called Input_String [].
    2. Replace the content of the original string with the string reversed and save into another array called Output_String [].
    3. 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]

    1. 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].
    2. 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 ( ).
    3. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions