Hey all!
Ok. I know that I can't mix char's and int's in the same array.
However, the HW problem I have is I have to create the table below. I have to allow a user to choose between any of the choices on this grid. (i.e A4 = 50 or E2 = 45). Two other noteworthy items are: 1. I have to allow those capital letters to be interchangeable with the lower case equivalent.(i.e a = A or E = e) 2. The order of the letter and number must also be interchangeable (i.e A1 = 1A or d2 = 2d).
I think the fact that I have to make things interchangeable is screwing with my head a little. I guess I just don't see the solution in my head yet. Once I know what I need to do I usually don't have many problems.
So should I create a separate array for A-E? Or is that totally wrong? Does anyone have any suggestions on where I should go with this problem?
1 2 3 4 5
+-------+-------+-------+-------+-------+
A | 35 | empty | 90 | 50 | 75 |
+-------+-------+-------+-------+-------+
B | 55 | 10 | empty | empty | 20 |
+-------+-------+-------+-------+-------+
C | empty | 85 | 40 | 95 | 60 |
+-------+-------+-------+-------+-------+
D | 15 | empty | 65 | 5 | 100 |
+-------+-------+-------+-------+-------+
E | 70 | 45 | 25 | 80 | 30 |
+-------+-------+-------+-------+-------+
I am not really looking for the exact answer here. Just need a little direction.
I have more code, but I can tell that it would do more harm than good to put those fragments here.
CODE
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
int grid[5][5] =
{
{ 35, 0, 90, 50, 75},
{ 55, 10, 0, 0, 20 },
{ 0, 85, 40, 95, 60 },
{ 15, 0, 65, 5, 100 },
{ 70, 45, 25, 80, 30 }
};
system("PAUSE");
return 0;
}
Thanks to anyone who helps me out here!!!!