1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ycow [4]
4 years ago
8

Assume an int array, candy, stores the number of candy bars sold by a group of children where candy[j] is the number of candy ba

rs sold by child j. Assume there are 12 children in all ,which of the following code could be used to compute the total number of bars sold by the children?
Scanner scan = Scanner.create(System.in); int value1 = scan.nextInt( ); int value2 = scan.nextInt( ); bars[value1] += value2;

1. adds value1 to the number of bars sold by child value2
2. adds 1 to the number of bars sold by child value1 and child value2
3. adds 1 to the number of bars sold by child value1
4. inputs a new value for the number of bars sold by both child value1 and child value2
5. adds value2 to the number of bars sold by child value1
Computers and Technology
1 answer:
Pepsi [2]4 years ago
8 0

Answer:

5. adds value2 to the number of bars sold by child value1

Explanation:

First, the code snippet create a Scanner object called scan.

Then it receive user input as value1. It then also receives another user input as value2.

From the question, we are told that candy[j] is the number of candy bars sold by child j. So, value1 represent number of candy bars by child 1 and value2 represent number of candy bars by child 2.

Therefore;

bars[value1] += value2;

adds value2 to the number of bars sold by child value1

You might be interested in
a uniform density sheet of metal is cut into a shape of an isosceles triangle, which is oriented with the base at the bottom and
Cloud [144]

The horizontal center of mass will be located at the horizontal center of mass will be located on the center line. This is further explained below.

<h3>What is Location?</h3>

Generally, a location or place that is inhabited, open for occupation or distinguished by some distinctive feature: situation The setting of the property contributes significantly to its overall allure.

In conclusion, The center line will serve as the location for the horizontal center of mass, which will be found at the same location as the center line.

Read more about Location

brainly.com/question/11718756

#SPJ1

6 0
2 years ago
George is only familiar with VGA connector for monitors. What should you tell him are the main differences between VGA and DVI c
lara [203]

Answer:

That a DVI connector looks different and that it support more monitors.

Explanation:

3 0
3 years ago
I.d 9934607467<br> p.a.s.s 54321<br><br> P.L.E.A.S.E J.O.I.N. Z.O.0.M. M.E.E.T.I.N.G
dusya [7]

Answer:

You could just go to social medIa to say j.o.i.n z.o.o.m not brainly mate

7 0
3 years ago
"The principle of ______________ states that programs tend to access data and instructions nearby recently used data and instruc
maria [59]

Answer:

<em>Locality of reference.</em>

Explanation:

In computing, The principle of locality of reference is the probability of a processor to repeatedly access the same set of memory locations within a small time interval. This reference of locality can be spatially based (repetitive usage of data within the same location on the computer memory), or temporally based (repetitive usage of a particular data or resources within a shot time interval). The ability of some computing system to perform this action increases their predictability, and efficiency of memory hierarchy use, among other abilities.

4 0
3 years ago
To reduce chances of system failure, engineers may use _____ .
Nataliya [291]
<span>To reduce chances of system failure, engineers may use process control. This is a system which involves activities that ensures the whole process variables can be predicted and controlled to prevent failure. This involves the use of safety valves and sensors.</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • If you want to boot from a hard drive what must it have
    6·1 answer
  • Yellow and blue light are projected on a white screen. what color will the screen appear to be?
    6·2 answers
  • Your sister wants to purchase Microsoft Office 2013 for her new laptop. She doesn't want to pay for a subscription, and she want
    12·1 answer
  • Where is line-of-sight Internet common?<br> In space<br> Outdoors<br> Inside<br> In businesses
    5·1 answer
  • Vghfthcnbvhghvngjgjvjgkb, kcnjc cnnfjdhd mc Dan Jfhjc cm. Cm n n hdjfjocnkcnd
    10·2 answers
  • Introduction to computing systems: from bits and gates to c and beyond
    7·1 answer
  • Fire Tint, Inc., (FTI), applies tint to airplane canopies (front windows) manufactured by other companies. When the canopy manuf
    12·1 answer
  • How to add a bill using the reciept capture?
    7·1 answer
  • Jason works for a restaurant that serves only organic, local produce. What
    15·2 answers
  • Explain the different type of shift register counter ​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!