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 130 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
Gracias!


ghepp

  • Member
  • Posts: 361
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

For high blood pressure (hypertension), a new class of drug, called a vasopeptidase blocker (inhibitor), has been developed. It decreases blood pressure by simultaneously dilating the peripheral arteries and increasing the body's loss of salt.

Did you know?

People often find it difficult to accept the idea that bacteria can be beneficial and improve health. Lactic acid bacteria are good, and when eaten, these bacteria improve health and increase longevity. These bacteria included in foods such as yogurt.

Did you know?

The most common childhood diseases include croup, chickenpox, ear infections, flu, pneumonia, ringworm, respiratory syncytial virus, scabies, head lice, and asthma.

Did you know?

It is believed that the Incas used anesthesia. Evidence supports the theory that shamans chewed cocoa leaves and drilled holes into the heads of patients (letting evil spirits escape), spitting into the wounds they made. The mixture of cocaine, saliva, and resin numbed the site enough to allow hours of drilling.

Did you know?

Malaria was not eliminated in the United States until 1951. The term eliminated means that no new cases arise in a country for 3 years.

For a complete list of videos, visit our video library