0 10 3 1 6 1 0 1 6 8 60 1 5 6 2 1 6 2 9 6 5 6 6 1 9 1 1 3 6 1 4 07 3 6 3 3 4 07 0 1031 6 1 0 10 3 1 6 1 0 1 6 8 0 10 3 1 6 1 0 1 6 8 9 6 2 1 0 1 6 8 60 1 5 6 2 1 8 2 9 6 5 6 1 1 9 1 136 1 4 07 3 3 3 3 4 07 6 0 1 5 5 2 1 6 01 8 2 9 6 5 6 11 4 0 7 8 2 9 6 9 6 1 1 9 1 15 6 1 4 07 1 391 3 5 33 4 07 3 3 3 9 407

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)
1st Edition
ISBN:9781305657458
Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Chapter6: Computing Components: Processors, Memory, The Cloud, And More
Section: Chapter Questions
Problem 6CT
icon
Related questions
Question

Write the following
method that tests whether a two-dimensional array has four consecutive numbers
of the same value, either horizontally, vertically, or diagonally:
public static boolean isConsecutiveFour(int[ ][ ] values)

 

Write a test program that prompts the user to enter the number of rows and
columns
of a two-dimensional array then the values in the array, and displays true
if the array contains four consecutive numbers with the same value. Otherwise,
the program displays false. Here are some examples of the true cases:

0 10 3 1 6 1
0 1 6 8 60 1
5 6 2 1 6 2 9
6 5 6 6 1 9 1
1 3 6 1 4 07
3 6 3 3 4 07
0 1031 6 1
0 10 3 1 6 1
0 1 6 8
0 10 3 1 6 1
0 1 6 8
9 6 2 1
0 1 6 8 60 1
5 6 2 1 8 2 9
6 5 6 1 1 9 1
136 1 4 07
3 3 3 3 4 07
6 0 1
5 5 2 1
6 01
8 2 9
6 5 6 11
4 0 7
8 2 9
6 9 6 1 1 9 1
15 6 1
4 07
1 391
3 5 33
4 07
3 3 3 9
407
Transcribed Image Text:0 10 3 1 6 1 0 1 6 8 60 1 5 6 2 1 6 2 9 6 5 6 6 1 9 1 1 3 6 1 4 07 3 6 3 3 4 07 0 1031 6 1 0 10 3 1 6 1 0 1 6 8 0 10 3 1 6 1 0 1 6 8 9 6 2 1 0 1 6 8 60 1 5 6 2 1 8 2 9 6 5 6 1 1 9 1 136 1 4 07 3 3 3 3 4 07 6 0 1 5 5 2 1 6 01 8 2 9 6 5 6 11 4 0 7 8 2 9 6 9 6 1 1 9 1 15 6 1 4 07 1 391 3 5 33 4 07 3 3 3 9 407
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 9 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning