Question: PLEASE HELP ME ASAP!! FOR JAVA USING ECLIPSE. Write a test program that prompts the user to enter a series of integers and displays whether

PLEASE HELP ME ASAP!! FOR JAVA USING ECLIPSE.
Write a test program that prompts the user to enter a series of integers and displays whether the series contains runLength consecutive same-valued elements. Your program's main() must prompt the user to enter the input size (the number of values in the series - dynamically allocate an appropriately sized array), the number of consecutive same-valued elements to match, and the sequence of integer values to check. The return value indicates whether at least one run of runLength elements exists in values. Implement the test program in the NConsecutiveUI class (the main() method is already in place), import statements for Scanner and hasNConsecutive () are already in place. Note: For the same inputs, your output must exactly match the following samples (pay attention to spacing, capitalization, etc.). Expected results: Enter the number of values: 3 How many consecutive, same-valued elements should I look for? 3 Enter 3 numbers: 5 5 5 The list has at least one sequence of 3 consecutive, same-valued elements Enter the number of values: 8 How many consecutive, same-valued elements should I look for? 4 Enter 8 numbers: 3 4 5 5 5 5 5 4 The list has at least one sequence of 4 consecutive, same-valued elements Enter the number of values: 3 How many consecutive, same-valued elements should I look for? 4 Enter 3 numbers: 5 5 5 The list has no sequences of 4 consecutive, same-valued elements 20 8270 import java.util.Scanner :o 30 316 /** * Write an interactive program that prompts the user to enter a series of * integers and displays whether the series contains n consecutive numbers with the same value. Your program should first prompt the user to enter the number 35 * of values in the series. * * * * * * @author Your Name 38 * @version 1.0.0 2020-01-26 initial version per assignment 39 */ 40 public class NConsecutiveUI 41 * 420 43 44 UI for the check for n-consecutive numbers assignment * * * @param args -unused - */ public static void main(String[] args) // STUB } // end main() } // end class NConsecutive
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
