









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










rating[3][j] = j;!
!! ArrayIndexOutOfBoundsException
0 1 2
public int countAbove(int[][] rating, int num) {! int count = 0;! for (int row = 0; row < ; row++) {! for (int col = 0; col < ; col++) {! ! if (rating[row][col] > num)! count++;! }! }! return count;! }! number of rows number of columns rating.length! rating[0].length!
int sum = 0;! for (int row = 0; row < ______________ ; row++) {! ! sum += rating[_____][____];! }! System.out.println((double) sum / ______________ );! rating.length row 3! rating.length
movie reviewer
rating[row].length row 3!
GiftCard[][] family = new GiftCard[3][4]!
public static void printValueOfRows(______________ data) {! for (int row = 0; row < __________________; row++) {! double total = ___________; // find total for the row! for (int col = 0; col < ___________________; col++) {! if (data[row][col] != ___________) {! total += data[row][col].getBalance();! }! }! System.out.println(“Row “ + row + “: $“ + total);! }! }! data.length data[row].length null
GiftCard[][]!