please I need help with this assignment

Please, do not double post.

http://www.cplusplus.com/forum/general/250030/

Nevertheless, could you be a little more specific what kind of help do you need?
Hello alice21,

Work small. Start with creating the menu. It sounds like you know about functions and a program that would contain more than one file.

I like to put the menu in a function that starts with a do.while loop,displays the menu and asks for the users choice. Then verify that the choice is valid before returning to only a valid choice.

Back in "main" you could do either:
1
2
3
4
5
6
7
8
9
10
11
int menuChoice{};

menuchoice = menu();

switch (menuChoice);

or simply

switch (menu())
{
}

To start with I would just let the program end when the switch is finished. Later you can put this in a loop.

For the case statements you can put a simple "std::cout" statement to reiterate the menu choice.

Next create your array and initialize it then work on the function that will display the array. This will be useful when writing your other functions.

Hope that helps,

Andy
To create and initialize an array is a very basic operation. Take a look through your class notes (or, having none, beg/borrow/steal some from a peer) and through your textbook about how to create arrays.

This site also has a fairly well-worked tutorial on arrays that touch on exactly what you need:
http://www.cplusplus.com/doc/tutorial/arrays/

Hope this helps.
@ alice21, the OP, deleted the post. Below is what the OP requested (OP, I got your back):

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:

Interchange column 2 with column 5

Count and display the number of vowels.

Display the array in a matrix (rows and columns)

Search for and display number of instances of any given character

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.
Last edited on
Topic archived. No new replies allowed.