1. ## Need a quick review - Welcome comments

Is there an easier way to do this????

//Tamra Hinton, Chapter 11, Problem 12
//Declare and initilize the array.
//Pass the array and the number of elements in an array
//Call the bubble sort routine and modify for a two dimensional array
//Display part information with a nestled for loop

Code:
```#include <iostream.h>

void sort (int parts[100][2],int size);

int main()
{
int parts[100][2];
int partsQuantity;
int i;
partsQuantity =0;
parts[partsQuantity][0] = 1001;
parts[partsQuantity++][1] = 62;
parts[partsQuantity][0] = 949;
parts[partsQuantity++][1] = 85;
parts[partsQuantity][0] = 1050;
parts[partsQuantity++][1] = 33;
parts[partsQuantity][0] = 867;
parts[partsQuantity++][1] = 125;
parts[partsQuantity][0] = 346;
parts[partsQuantity++][1] = 59;
parts[partsQuantity][0] = 1025;
parts[partsQuantity++][1] = 105;

sort(parts,partsQuantity);

cout << "Part No.\t\tQuantity\n\n";
for (i = 0; i < partsQuantity; i++)
cout << parts[i][0] << "\t\t" << parts[i][1];
cout << endl;

return 0;
}

void sort (int parts[100][2],int size)
{
int t[2];
int i,j;

for (i = 0; i < size-1; i++ )
{
for ( j = 1; j < size-i; j++ )
{
if ( parts[j-1][1] < parts[j][1] )
{
t[0] = parts[j-1][0];
t[1] = parts[j-1][1];
parts[j-1][0] = parts[j][0];
parts[j-1][1] = parts[j][1];
parts[j][0] = t[0];
parts[j][1] = t[1];
}
}
}
return;
}```
__________________________________________________ __i

How would you modify this program? Would I be able to use something like this....
int main()

{

const int part = 100;
int [part ] = [1001, 949, 1050, 867, 346, 1025];
const int quantity = 2;
int [quantity] = [62, 85, 33, 125, 59, 105]

2. ----------------------------------------------------------------------------

const int part = 100;
int [part ] = [1001, 949, 1050, 867, 346, 1025];
const int quantity = 2;
int [quantity] = [62, 85, 33, 125, 59, 105]

----------------------------------------------------------------------------

Above mentioned code will not work definitely.

You don't have declared variable name in 2nd and 4th line

3. For the first part, if you can use different numbers:

Code:
```for (x = 0; x < 100; x++)
{
for (y = 0; y < 2; y++)
{
parts[x][y] = ...
}
}```
The last part will work, you just need curley braces and have a name, like so:

Code:
`int name[part] = {1001, 949, 1050, 867, 346, 1025};`