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

Author Question: Analyze the following code.double sum = 0;for (double d = 0; d < 10; sum += sum + d) { d += 0.1;} (Read 129 times)

mp14

  • Hero Member
  • *****
  • Posts: 534
Analyze the following code.

double sum = 0;
for (double d = 0; d < 10; sum += sum + d) {
d += 0.1;
}

◦ The program has a syntax error because the control variable in the for loop cannot be of the double type.
◦ The program compiles but does not stop because d would always be less than 10.
◦ The program compiles and runs fine.
◦ The program has a syntax error because the adjustment statement is incorrect in the for loop.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by mp14 on May 6, 2020

lorealeza

  • Sr. Member
  • ****
  • Posts: 345
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 25% of students answer this correctly




mp14

  • Member
  • Posts: 534
Reply 2 on: May 6, 2020
Excellent


xiaomengxian

  • Member
  • Posts: 311
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

The average older adult in the United States takes five prescription drugs per day. Half of these drugs contain a sedative. Alcohol should therefore be avoided by most senior citizens because of the dangerous interactions between alcohol and sedatives.

Did you know?

Approximately 500,000 babies are born each year in the United States to teenage mothers.

Did you know?

Many supplement containers do not even contain what their labels say. There are many documented reports of products containing much less, or more, that what is listed on their labels. They may also contain undisclosed prescription drugs and even contaminants.

Did you know?

Essential fatty acids have been shown to be effective against ulcers, asthma, dental cavities, and skin disorders such as acne.

Did you know?

Vital signs (blood pressure, temperature, pulse rate, respiration rate) should be taken before any drug administration. Patients should be informed not to use tobacco or caffeine at least 30 minutes before their appointment.

For a complete list of videos, visit our video library