PROCESSING
You will need to store the appropriate characters in each element of the array. The formula for the 'X' is as follows:
Elements at index positions where each index is the same should be given a value of '*'.
For example, [0][0],[1][1], and so on. This covers the rst diagonal line we need to create.
The second diagonal can be created by storing '*' in the positions where both indexes add up to the
size eld's current value minus one.
For example, if the size is 5, the elements would be [0][4], [1][3], [2][2], [3][1], and [4][0].
Every other element should be ' ' (a space). This will ensure the array prints correctly.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |