Page 401 - AP Computer Science A, 7th edition
P. 401
I
II
III
(A) I only
(B) II only
(C) III only
(D) I and II only (E) I, II, and III
if (p.getx() < 0 || p.gety() < 0) p.setPoint(0, 0);
for (int r = 0; r < pointMat.length; r++) for (int c = 0; c < pointMat[r].length; c++)
if (pointMat[r][c].getx() < 0 || pointMat[r][c].gety() < 0)
pointMat[r][c].setPoint(0, 0);
for (int c = 0; c < pointMat[0].length; c++) for (int r = 0; r < pointMat.length; r++)
if (pointMat[r][c].getx() < 0 || pointMat[r][c].gety() < 0)
pointMat[r][c].setPoint(0, 0);
for (Point[] row : pointMat) for (Point p : row)
37. A simple Tic-Tac-Toe board is a 3 × 3 array filled with either X’s, O’s, or blanks.
Here is a class for a game of Tic-Tac-Toe: