subject

Tiffany is writing a program to help manage a bake sale. She writes the following code which prompts the user to enter the total number of items a person is buying and then a loop repeatedly prompts for the cost of each item. She wrote the code but there is a problem: it runs in an infinite loop. How can Tiffany change her code so it doesn't loop forever?line 0 -- var numItems = promptNum("How many items?");line 1-- var total = 0;line 2-- while (numItems > 0){line 3-- total = total + promptNum("Enter next item price");line4-- }line 5-- console. log("The total is" + total);A) Change Line 1 to:var total = -1;B) Change Line 2 to:while (itemsInCart >= 0){C) Change Line 3 to:total = promptNum("Enter next item price");D) Add after line 3:numItems = numItems - 1;E) Add after line 4:numItems = 0;

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 13:30, Ryan02717
Question 1(multiple choice worth 5 points) (06.04 mc) how are the respiratory and circulatory systems similar? both systems provide glucose and other substances to cells. both systems regulate blood flow throughout the body. both systems remove carbon dioxide from the body. both systems send messages to the nervous system for breathing. question 2(multiple choice worth 5 points) (06.04 lc) the respiratory system controls and the circulatory systems controls antibodies; digestion breathing; blood flow muscles; bones nerves; senses question 3(multiple choice worth 5 points) (06.04 hc) read the following summary, which describes a body process. then, answer the question. blood enters the right side of the heart and travels to the lungs. there, the lungs eliminate carbon dioxide and exchange it for more oxygen. the oxygen-rich blood enters the left side of the heart. then, arteries carry blood away from the heart. what process is being described? circulation excretion immune response respiration question 4(multiple choice worth 5 points) (06.04 lc) the system is responsible for moving blood cells throughout the body. circulatory endocrine immune respiratory question 5(multiple choice worth 5 points) (06.04 mc) which of the following functions as part of the excretory and respiratory systems? blood heart intestines lungs
Answers: 1
image
Computers and Technology, 22.06.2019 10:00, hailee232
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
image
Computers and Technology, 23.06.2019 04:10, cvbnkifdfg
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
image
Computers and Technology, 23.06.2019 11:00, danielcano12281621
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
You know the right answer?
Tiffany is writing a program to help manage a bake sale. She writes the following code which prompts...

Questions in other subjects:

Konu
English, 24.02.2021 03:10
Konu
Mathematics, 24.02.2021 03:10
Konu
Biology, 24.02.2021 03:10