This topic contains a solution. Click here to go to the answer

Author Question: For the questions below, assume an int array, candy, stores the number of candy bars sold by a group ... (Read 159 times)

fox

  • Hero Member
  • *****
  • Posts: 540
For the questions below, 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 bars 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?
◦ for (int j=0; j<12; j++) sum += candy[j];
◦ for (int j=0; j<12; j++) candy[j] = sum;
◦ for (int j=0; j<12; j++) sum = candy[j];
◦ for (int j=0; j<12; j++) sum += [j];
◦ for (int j=0; j<12; j++) [j] += sum;


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by fox on Aug 30, 2020

ttt030911

  • Sr. Member
  • ****
  • Posts: 315
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 49% of students answer this correctly




fox

  • Member
  • Posts: 540
Reply 2 on: Aug 30, 2020
:D TYSM


abro1885

  • Member
  • Posts: 337
Reply 3 on: Yesterday
Wow, this really help

 

Did you know?

Though methadone is often used to treat dependency on other opioids, the drug itself can be abused. Crushing or snorting methadone can achieve the opiate "rush" desired by addicts. Improper use such as these can lead to a dangerous dependency on methadone. This drug now accounts for nearly one-third of opioid-related deaths.

Did you know?

Sperm cells are so tiny that 400 to 500 million (400,000,000–500,000,000) of them fit onto 1 tsp.

Did you know?

Alcohol acts as a diuretic. Eight ounces of water is needed to metabolize just 1 ounce of alcohol.

Did you know?

Congestive heart failure is a serious disorder that carries a reduced life expectancy. Heart failure is usually a chronic illness, and it may worsen with infection or other physical stressors.

Did you know?

Barbituric acid, the base material of barbiturates, was first synthesized in 1863 by Adolph von Bayer. His company later went on to synthesize aspirin for the first time, and Bayer aspirin is still a popular brand today.

For a complete list of videos, visit our video library