Wyo C++
Ch. 15 Worksheet #2                                                                                 Name:

Answer the following as completely as necessary based on the apmatrix class.

1. Write a statement that declares an apmatrix of integers named myMatrix with 3 rows and 4 columns.

 


2. Write a statement that declares an apmatrix of char variables named myMatrix with 2 columns and 5 rows and initializes each element with the character 'X'.


 


3. Write a statement that declares an apmatrix of bool variables named ticTacToe with 3 columns and 3 rows and initializes each element with the Bool value false.

 

 

4. Write a statement that assigns the contents of the apmatrix yourMatrix to the apmatrix myMatrix.

 

 

5. Write a statement that resizes an apmatrix named myMatrix so that it has 3 columns and 4 rows.

 

 

6. Write nested for loops that display all of the elements of an apmatrix of apstrings named myMatrix no matter how many rows and columns are found there? Make sure that the elements are displayed in rows and columns as one would envision them being stored there with one single blank space between elements found on each row but each row of elements in a different line of output.










7. Write nested for loops that assign the value 5 to each position of an apmatrix of integers named myMatrix no matter how many rows and columns are found there? (Use the back of the paper if necessary)