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

Author Question: To add 0.01 + 0.02 + ... + 1.00, what order should you use to add the numbers to get better accuracy? (Read 125 times)

sabina

  • Hero Member
  • *****
  • Posts: 563

Question 1

How many times is the println statement executed?

for (int i = 0; i < 10; i++)
for (int j = 0; j < i; j++)
System.out.println(i * j)

◦ 100
◦ 45
◦ 20
◦ 10

Question 2

To add 0.01 + 0.02 + ... + 1.00, what order should you use to add the numbers to get better accuracy?
◦ Add 0.01, 0.02, ..., 1.00 in this order to a sum variable whose initial value is 0.
◦ Add 1.00, 0.99, 0.98, ..., 0.02, 0.01 in this order to a sum variable whose initial value is 0.


Related Topics

Need homework help now?

Ask unlimited questions for free

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

Juro

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




sabina

  • Member
  • Posts: 563
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


tuate

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

 

Did you know?

As the western states of America were settled, pioneers often had to drink rancid water from ponds and other sources. This often resulted in chronic diarrhea, causing many cases of dehydration and death that could have been avoided if clean water had been available.

Did you know?

Sildenafil (Viagra®) has two actions that may be of consequence in patients with heart disease. It can lower the blood pressure, and it can interact with nitrates. It should never be used in patients who are taking nitrates.

Did you know?

Acetaminophen (Tylenol) in overdose can seriously damage the liver. It should never be taken by people who use alcohol heavily; it can result in severe liver damage and even a condition requiring a liver transplant.

Did you know?

Approximately one in three babies in the United States is now delivered by cesarean section. The number of cesarean sections in the United States has risen 46% since 1996.

Did you know?

Parkinson's disease is both chronic and progressive. This means that it persists over a long period of time and that its symptoms grow worse over time.

For a complete list of videos, visit our video library