Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative number is not a part of the sorted list). Assume the number of integers is...


I need help solving this in JAVA


Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative number is not a part<br>of the sorted list). Assume the number of integers is always odd.<br>Ex: If the input is:<br>2 3 4 8 1l -1<br>the output is:<br>Middle item: 4<br>The maximum number of list values for any test case should not exceed 9. If exceeded, output

Extracted text: Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative number is not a part of the sorted list). Assume the number of integers is always odd. Ex: If the input is: 2 3 4 8 1l -1 the output is: Middle item: 4 The maximum number of list values for any test case should not exceed 9. If exceeded, output "Too many numbers". Hint: First read the data into an array. Then, based on the array's size, find the middle item.
1 import java.util.Scanner;<br>3 public class LabProgram {<br>public static void main(String args) {<br>Scanner scnr = new Scanner(System.in);<br>int[] userValues = new int[9]; // Set of data specified by the user<br>4<br>6.<br>8.<br>/* Type your code here. */<br>}<br>9.<br>10 }<br>11<br>Run your program as often as you'd like, before submitting for grading. Below, type any needed<br>input values in the first box, then click Run program and observe the program's output in the<br>Develop mode<br>Submit mode<br>second box.<br>Enter pregra m input lontion<br>

Extracted text: 1 import java.util.Scanner; 3 public class LabProgram { public static void main(String args) { Scanner scnr = new Scanner(System.in); int[] userValues = new int[9]; // Set of data specified by the user 4 6. 8. /* Type your code here. */ } 9. 10 } 11 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the Develop mode Submit mode second box. Enter pregra m input lontion

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here