Question: Instead of having your program get input from the keyboard make it read the data from a text files file.(1-6) Pass the name of the
Instead of having your program get input from the keyboard make it read the data from a text files file.(1-6)
Pass the name of the file into your program as a command line argument...
Have your "isConsecutiveFour" method print out the number of horizontal, vertical and diagonal matches it found in the file. Have your main method print out the return value of your "isConsecutiveFour" method (true or false)
(Pattern recognition: consecutive four equal numbers) Write the following method that tests whether a two-dimensional array has four consecutive num- bers 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 and then the values in the array and dis- plays true if the array contains four consecutive numbers with the same value. Otherwise, display false. Here are some examples of the true cases: 0 1 0 3 1 6 1 0 1 0 3 1 6 1 0 1 0 3 1 6 1 0 1 0 3 1 6 1 0 1 6 8 60 1 0 1 6 8 60 1 0 1 68 60 1 0 1 68 60 1 5 6 2 1 8 29 5 5 2 1 8 2 9 5 6 2 1 16 2 9 9 6 2 1 8 2 9 6 5 6 6 1 9 1 6 5 6 1 1 9 1 6 5 6 1 1 9 1 69 6 1 1 9 1 1 3 6 1 4 0 7 1 5 6 1 40 7 1 3 6 1 4 07 1 3 9 1 4 0 7 3 3 3 3 4 07 3 5 3 3 40 7 3 6 3 3 4 0 7 3 3 39 4 07
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
