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 126 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!


shewald78

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

 

Did you know?

About 100 new prescription or over-the-counter drugs come into the U.S. market every year.

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?

More than 20 million Americans cite use of marijuana within the past 30 days, according to the National Survey on Drug Use and Health (NSDUH). More than 8 million admit to using it almost every day.

Did you know?

Complications of influenza include: bacterial pneumonia, ear and sinus infections, dehydration, and worsening of chronic conditions such as asthma, congestive heart failure, or diabetes.

Did you know?

Hip fractures are the most serious consequences of osteoporosis. The incidence of hip fractures increases with each decade among patients in their 60s to patients in their 90s for both women and men of all populations. Men and women older than 80 years of age show the highest incidence of hip fractures.

For a complete list of videos, visit our video library