Question: Integer numValues is read from input, representing the number of integers to be read next. Then, the remaining integers are read and stored into

Integer numValues is read from input, representing the number of integers to

 be read next. Then, the remaining integers are read and stored into

Integer numValues is read from input, representing the number of integers to be read next. Then, the remaining integers are read and stored into array inventories List. For each element in inventories List that is greater than 2000: Output the element, followed by " is corrected to 2000" and a newline. Assign the element with 2000. Ex: If the input is: 3 1000 2475 2225 then the output is: Raw inventories: 1000 2475 2225 2475 is corrected to 2000 2225 is corrected to 2000 Adjusted inventories: 1000 2000 2000 HERSTELBAREN 1 import java.util.Scanner; 3 public class ArrayResize { 6 8 10 11 12 13 14 15 16 17 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int[] inventoriesList; int numValues; int i; numValues= scnr.nextInt (); inventoriesList = new int[numValues]; for (i = 0; i < inventoriesList.length; ++i) { inventoriesList[i] scnr.nextInt (); } = 3 278922 16 17 18 19 20 21 22 23 24 24 25 25 27 28 29 30 31 32 26 32} } } System.out.print("Raw inventories: "); for (i = 0; i < inventoriesList.length; ++i) { System.out.print(inventories List[i] + "); } System.out.println(); /* Your code goes here */ System.out.print("Adjusted inventories: "); for (i = 0; i < inventoriesList.length; ++i) { System.out.print (inventories List[i] + System.out.println(); } 4

Step by Step Solution

3.45 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilScanner public class ArrayResize public static void mainString args Scanner s... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!