Given the integer array average Temps with the size of NUM_IN, write a for loop that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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); 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);
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class ThresholdTracker public static void mainString args Scanner scnr ... View the full answer
Related Book For
Computer Architecture A Quantitative Approach
ISBN: 978-0123704900
4th edition
Authors: John L. Hennessy, David A. Patterson
Posted Date:
Students also viewed these programming questions
-
Use the table below to find: (fog)(-10) = (fof) (11) = X -10 f(x) -1 g(x) 4 -1 -7 -4 -7 11 (gof)(-4)= (gog)(7) = 4 7 15 4 7 -4 11 -4 15 7 -1 15 -10 -7 -10 11
-
The drawing shows a frictionless incline and pulley. The two blocks are connected by a wire (mass per unit length = 0.0250 kg/m) and remain stationary. A transverse wave on the wire has a speed of...
-
Cash Equation Details Corp has a book net worth of $8,500. Long-term debt is $1,800. Net working capital, other than cash, is $2,380. Fixed assets are $6,400. How much cash does the company have? If...
-
The balance sheet (computer aging) method is used to estimate the balance of the Allowance for Doubtful Accounts account for the end of each quarter. The program has analyzed all accounts receivable...
-
The refrigerating capacity of 165 domestic refrigerators is approximately equal to: (a) 0.05 ton (b) 0.1 ton (c) 2 ton (d) 5 ton
-
Dry air at 35C and a velocity of 10 m/s flows over a thin-walled tube of 20-mm diameter and 200-mm length, having a fibrous coating that is water-saturated To maintain an approximately uniform...
-
Briefly describe any FOUR advantages of using comments in a program.
-
We left Lou for a few weeks and despite his best intentions, he has not been staying on top of his bookkeeping. With the new apartment complex account, business is booming. Probably. Maybe? It's hard...
-
A form of nonrenewable alternative energy can be: Oil Coal Geothermal Gas
-
For the year ended June 30, 20X9, a university assessed its students a total of $4,000,000 for tuition and fees. Included in this amount were $300,000 of tuition remissions awarded to graduate...
-
Early AI developers measured the intelligence of the technology by its ability to play games, such as chess. Why might this definition of intelligence be limiting? What other forms of intelligence...
-
Various types of project reports may be distributed to stakeholders, "and should be adapted to provide information at an appropriate level, format, and detail for each type of stakeholder" (PMI,...
-
In general, if any user plans for any tour they must consult any traveling agency for purchasing package. The user has to do traveling reservations from source to destination. At the same time, the...
-
Provide ONE IT-based CPM network example; the example should include at minimum the following elements: A. 10 tasks B. 3 tasks done simultaneously C. Identify the critical path and provide the...
-
We consider a government raising a quantity of debt bt+1 at date t at a price qt < 1. This debt implies a debt repayment in the following period of bt+1. The government has a debt inherited from the...
-
At the beginning of the year, Lam Ltd. had total assets of $800,000 and total liabilities of $500,000. Use this information to answer each of the following independent questions. (a) If Lam's total...
-
Exercise 4.5 asks you to add the Exclusive state to the simple MSI snooping protocol. Discuss why this is much more difficult to do with the simple directory protocol. Give an example of the kinds of...
-
We will start by configuring a system to complete a sort in the least possible time, with no limits on how much we can spend. To get peak bandwidth from the sort, we have to make sure all the paths...
-
The following questions investigate the impact of small and simple caches using CACTI, and assume a 90 nm (0.09 m) technology. a. Compare the access times of 32 KB caches with 64-byte blocks and a...
-
Refer to requirement 2 of Exercise4.11. Required Prepare summary journal entries for the use of direct materials and conversion costs. Also prepare a journal entry to transfer out the cost of goods...
-
Describe the distinctive characteristic of weighted-average computations in assigning costs to units completed and closing work in progress.
-
Europe Electronics SNC manufactures microchips in large quantities. Each microchip undergoes assembly and testing. The total assembly costs during January 2022 were: Required 1 Assume there was no...
Study smarter with the SolutionInn App