I am looking to finish up this program for class. I'm lost when it comes to arrays and I've read all the course work, the book, etc. The question is how do you increase an array element at the position?
using namespace std;
int main()
{
int quantity[4][5], warehouse, product;
int inventory[4][5] = {
{900,400,250,95,153},
{52, 95, 625, 44, 250},
{100,720,301,50,878},
{325,650,57,445,584},
};
cout << "Enter the warehouse number between 1 and 4: " << endl;
cin >> warehouse;
cout << "Enter the product location between 1 and 5: " << endl;
cin >> product;
cout << "Enter the quanity delivered: " << endl;
cin >> quantity[4][5];
/* First the addition */
for(warehouse = 0; warehouse < 4; warehouse++)
for(product = 0; product < 5; product++)
quantity[warehouse][product] = inventory[warehouse][product] +
quantity[4][5];
cout << "The amount of units in warehouse " << warehouse << " is \n\n";
/* Then print the results */
for(warehouse = 0; warehouse < 4; warehouse++ ) {
for( product = 0; product < 5; product++ )
cout << "\t" << quantity[warehouse][product];
cout << endl; /* at end of each warehouse */
}
return 0;
}