lundi 18 février 2019

C++ assigment. help please

Please design, write the code and create the requisite submission files for the following problem:

Functional Requirements:

A menu-driven program that offers the user a grid of characters and then 5 options to change the grid as follows:

Menu:

  1. Interchange column 2 with column 5

  2. Count and display the number of vowels.

  3. Display the array in a matrix (rows and columns)

  4. Search for and display number of instances of any given character

  5. Exit

Programming Requirements:

In main(), declare and initialize a 2-dimensional array of characters that contains 5 x 5 elements. Initialize the elements to:

s l o a n

h o r s e

e g r i t

h o u s e

w a t e r

Display the menu and then execute the user's choice. Keep displaying the menu (and executing the user's choice) until the user chooses Option 5. (See pseudocode in this lesson for design help.)

Programming Notes:

In menu option 1, swap the actual array values. Don't display the array. That's a different menu option.

In menu option 2, display the total number of vowels.

In menu option 3, display the array as a matrix (ie, rows and columns). Leave spaces between each character. Use the iomanip library to help you create a nice display.

In menu option 4, prompt the user for one character. Search the array and count the number of times it occurs. Display the results.

In menu option 5, say goodbye and exit the program.

Execute the chosen menu option by passing the array to a specific function which will do the work (in other words, there will be 4 array processing functions and one exit function).

No global variables, although global constants are fine. Remember, you must pass the array to the functions and not do the work in main().

Properly document your code with header blocks for each function and internal comments. I have attached a template program to this lesson so you can see what I am looking for.

Aucun commentaire:

Enregistrer un commentaire