Question: This assignment provides practice programming with pointers and dynamically allocated arrays Provided for you is triangluarArraysMain.cpp, a file that contains a main function, along with

 This assignment provides practice programming with pointers and dynamically allocated arraysProvided for you is triangluarArraysMain.cpp, a file that contains a main function,along with functions that create, fill, and print triangular arrays (see https://en.wikipedia.org/wiki/Triangular

This assignment provides practice programming with pointers and dynamically allocated arrays Provided for you is triangluarArraysMain.cpp, a file that contains a main function, along with functions that create, fill, and print triangular arrays (see https://en.wikipedia.org/wiki/Triangular array_for some background on triangular arrays), and a function that prints a square array (one that has the same number of rows as columns). Your task (should you decide to accept it) is to create a function called convertTriArray2Square(), whose prototype is already specified in triangluarArraysMain.cpp. Put your function convertTriArray2Square(), in a file called convertTriArray2Square.cpp The function convertTriArray2Square() should dynamically create a square array with the same number of rows and columns as the triangular array had rows. So if the triangular array had 10 rows, the square array should have 10 rows and 10 columns. Then the function convertTriArray2Square) should fill the new array with the same data, in the same locations as the triangular array and also reflect that data across the diagonal, cting a symmetric array (where array[row] [col] = array[col][row]) Shown below is an example run of triangluarArraysMain. Note that the output consists of random numbers, but that the final array is symmetric about the diagonal :g Wall convertTriArray2Square.cpp triangularArraysMain.cpp -o triangularArraysMain : triangularArraysMain 9 9 Rows 41 6 62 62 27 36 24 64 6 91 16 12 73 0 69 78 58 62 64 5 45 81 27 61 91 95 42 27 36 91 4 2 53 92 82 21 16 18 95 47 26 71 38 69 12 67 99 35 94 3 11 22 33 73 41 67 0 78 5 91 4 18 67 67 34 69 58 45 95 2 9599 0 69 24 62 81 42 53 47 35 78 58 62 64 27 27 92 26 94 5 45 81 27 61 36 82 71 3 91 95 42 27 3691 21 38 11 4 2 53 92 82 21 16 69 22 18 95 47 26 71 38 69 12 33 67 99 35 94 3 11 22 33 73 Submit convertTriArray2Square.cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!