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 123 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
Great answer, keep it coming :)


sultana.d

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

 

Did you know?

According to the American College of Allergy, Asthma & Immunology, more than 50 million Americans have some kind of food allergy. Food allergies affect between 4 and 6% of children, and 4% of adults, according to the CDC. The most common food allergies include shellfish, peanuts, walnuts, fish, eggs, milk, and soy.

Did you know?

Walt Disney helped combat malaria by making an animated film in 1943 called The Winged Scourge. This short film starred the seven dwarfs and taught children that mosquitos transmit malaria, which is a very bad disease. It advocated the killing of mosquitos to stop the disease.

Did you know?

The most common treatment options for addiction include psychotherapy, support groups, and individual counseling.

Did you know?

If you use artificial sweeteners, such as cyclamates, your eyes may be more sensitive to light. Other factors that will make your eyes more sensitive to light include use of antibiotics, oral contraceptives, hypertension medications, diuretics, and antidiabetic medications.

Did you know?

Oliver Wendell Holmes is credited with introducing the words "anesthesia" and "anesthetic" into the English language in 1846.

For a complete list of videos, visit our video library