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


Integer numBenefits is read from input, representing the number of integers to be read next. Then, the remaining integers are read and stored into array benefitsArray. For each element in benefitsArray that is less than 170: Output the element, followed by ": corrected to 70 plus the current value" and a newline. Assign the element with the element's current value plus 70. Ex: If the input is: 3 225 125 65 then the output is: Raw benefits: 225 125 65 125: corrected to 70 plus the current value 65: corrected to 70 plus the current value Adjusted benefits: 225 195 135. 1 import java.util.Scanner; 4234 in 1890 3 public class ArrayResize { 5 6 7 10 11 TELEP RP 4557WNI 12 13 14 15 16 17 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int[] benefitsArray; int numBenefits; int i; numBenefits scnr.nextInt(); benefitsArray = new int [numBenefits]; for (i = 0; i < benefitsArray.length; ++i) { benefitsArray[i] = scnr.nextInt (); } 14 4567 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 m for (i = 0; i < benefitsArray.length; ++i) { benefitsArray[i] = scnr.nextInt (); } System.out.print("Raw benefits: "); for (i = 0; i < benefitsArray.length; ++i) { System.out.print (benefitsArray[i] + 11 } System.out.println(); /* Your code goes here */ System.out.print("Adjusted benefits: "); for (i = 0; i < benefitsArray.length; ++i) { System.out.print (benefitsArray[i] + } System.out.println();
Step by Step Solution
3.45 Rating (145 Votes )
There are 3 Steps involved in it
import javautilScanner public class ArrayResize public static void mai... View full answer
Get step-by-step solutions from verified subject matter experts
