id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

tlsmith2@wsfcs.k12.nc.us > array2DAllRows100
prev  |  next  |  chance

Return true if all rows in nums contain an element that is at least 100. Return false otherwise.

Important Note: Copy the following two methods into the window and don't change 
array2DAllRows100.  CodingBat does not allow 2D array parameters, so this method is accepting 
the number of rows, number of columns, and a 1D array.  The first method takes this 
information and creates a 2D array named nums that you will be using. Enter your code into 
method array2DAllRows100B:

public boolean array2DAllRows100(int rows, int cols, int[] array)
{
	int[][] array2D = new int[rows][cols];
	int idx = 0;
	for (int r=0; r<rows; r++)
	{
		for (int c=0; c<cols; c++)
		{
			array2D[r][c] = array[idx];
			idx++;
		}
	}
	return array2DAllRows100B(array2D);
}

public boolean array2DAllRows100B(int[][] nums) { 
	
}

array2DAllRows100(2, 4, [50, 100, 30, 20, 60, 70, 80, 90]) → false
array2DAllRows100(2, 4, [50, 2, 300, 20, 60, 70, 800, 90]) → true
array2DAllRows100(3, 3, [50, 2, 300, 20, 60, 70, 800, 90, 100]) → false

...Save, Compile, Run (ctrl-enter)

public boolean array2DAllRows100(int rows, int cols, int[] array)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 10 Post-solution available

Copyright Nick Parlante 2017 - privacy