I have an assignment that I am having problems with. I don't use C++ on a daily basis at work but needed to take the class for school and I am having trouble with this assignment. Here is the question:
"C++ Please A 2-D array has these 20 elements: 3 33 333 3333 5 55 555 5555 1 11 111 1111 4 44 444 4444 2 22 222 2222 Write an exchange maximum program to do the following: a. Sort the array so that it will look like this: 5 55 555 5555 4 44 444 4444 3 33 333 3333 2 22 222 2222 1 11 111 1111 b. Sort the array so that it will look like this: 1111 111 11 1 2222 222 22 2 3333 333 33 3 4444 444 44 4 5555 555 55 5"
Here is the code that I have done but I get 0's to return and when I enter the elements for the array they all come back as 3's. Thanks for any help.
#include<iostream>
using namespace std;
class matrix
{
private:
int mat[5][4];
public:
matrix();
void create();
void display();
void sorthigh(matrix &m1);
void sortlow(matrix &m2);
};