Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the integer array average Temps with the size of NUM_IN, write a for loop that sums each integer of average Temps together until
Given the integer array average Temps with the size of NUM_IN, write a for loop that sums each integer of average Temps together until either maxSum is greater than or equal to 150 or the end of the array is reached. Ex: If the input is 11 4 9 1 10 14 8 5, then the output is: Maximum sum: 62 3 public class ThresholdTracker { tin6789SCTED 4 5 PHP 10 11 12 13. 14 15 16 17 18 19} public static void main(String[] args) { Scanner scnr = new Scanner(System.in); final int NUM_IN = 8; int[] average Temps = new int [NUM_IN]; int i; int maxSum; } for (i = 0; i < averageTemps.length; ++i) { average Temps[i] scnr.nextInt (); } /* Your code goes here */ System.out.println("Maximum sum: = 11 + maxSum);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import javautilScanner public class ThresholdTracker public static void mainString args Scanner scnr ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started