Question: Write a GUI program for Programming Exercise 8.19, as shown in Figure 16.49a?b. Let the user enter the numbers in the text fields in a
Write a GUI program for Programming Exercise 8.19, as shown in Figure 16.49a?b. Let the user enter the numbers in the text fields in a grid of 6 rows and 7 columns. The user can click the Solve button to highlight a sequence of four equal numbers, if it exists. Initially, the values in the text fields are filled with numbers from 0 to 9 randomly.
Write the following method that tests whether a two-dimensional array has four consecutive numbers of the same value, either horizontally, vertically, or diagonally.

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

A consecutive four found A consecutive four found 6 0 3 3 8 5 2 6 0 3 38 5 2 9 7 9 0 8 7 7 37 2 8 2 111 1 3 1 9 0 7 3 9 4 9 7 4 1 4 1 9 3 4 3 5 9 7 1 2 6 5 9 4 4 6 4 1 6 4 1 6 2 2 2 2 5 1 5 1 Sol ve Solve (a) (b) 1. 2. public static boolean isConsecutiveFour(int[I) values)
Step by Step Solution
3.30 Rating (171 Votes )
There are 3 Steps involved in it
Program Plan The program creates a graphical user interface with reference to the Exercise 819 that is displayed in the image Figure 1649ab comprising a grid of 6 rows and 7 columns The user is given ... View full answer
Get step-by-step solutions from verified subject matter experts
