Please check my work on the following questions! I think I got most of them, but
ID: 3561856 • Letter: P
Question
Please check my work on the following questions! I think I got most of them, but I don't want to get any points taken off for this assignment! I'm only interested in people that can code this in C++. Don't bother answering otherwise.
Consider the following code:
char quick[SIZE][SIZE][SIZE][SIZE-1];
I think the answer would be something like (3xSIZE)x(SIZE -1)
for(int i=0; i < SIZE; i++){
for(int j=0; j < SIZE; j++){
for(int k=0; k < SIZE; k++){
for(int m=0; m < SIZE; m++){
quick[ i ][ j ][ k ][ m - 1] = " ";
}
}
}
}
Explanation / Answer
Your 1st answer is incorrect!It should be size * size * size * (size - 1).
Also, there is 1 minor error in 2nd one. In the last loop, it should iterate from (0 to size - 1), and it should be quick[ i ][ j ][ k ][ m] = " ";, not quick[ i ][ j ][ k ][ m - 1] = " "; like this:
for(int i=0; i < SIZE; i++){
for(int j=0; j < SIZE; j++){
for(int k=0; k < SIZE; k++){
for(int m=0; m < SIZE - 1; m++){
quick[ i ][ j ][ k ][ m] = " ";
}
}
}
}