Question: Create a program in c++ that will randomly create a two dimension array of size n and then sort 1 it. 1. Prompt the user
Create a program in c++ that will randomly create a two dimension array of size n and then sort1 it.
1. Prompt the user for a range of valid size, n: From 1 6 inclusive.
2. Create a void function that will randomly load up the 2-dim array of size ??2 with numbers from 1 to 3??2+4, based on this value from part (1).
3. Create a void function that will sort the 2-dimensional array from part (2).
4. Create a function that will print the cells of the original array and then print the cells of the sorted array 6 items per line.
5. The output should look like the following: (The rows must be lined up properly)
The original array is: [0][0]= 15, [0][1]= 200, [0][2]= 12,
The sorted array is: [0][0]= 10, [0][1]= 11, [0][1]= 12, .
[2][0]= 49, [2][1]= 67, [2][2]= 78
6. Test your program with the following values of n:
1, 2, 3, 4
Notes:
- The rows MUST BE aligned in order for you to get credit - Use setw( ) function for that)
- Do not create a sort function. Investigate the header file called
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
