1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
loris [4]
3 years ago
5

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;
Computers and Technology
1 answer:
Katyanochek1 [597]3 years ago
8 0

Answer:

Option D is the correct answer for the above question.

Explanation:

  • The above question code executes the infinite while loop because there is no operation in the loop body which helps the loop condition to be false in any iteration of the while loop.
  • Every while loop contains the three thinks, one is starting value for the loop, the second is a condition which states that the body of the loop will execute or not and the third is an operation which states the condition variable to be false or true.
  • The above program has only two think the starting value which is given by the user in numItems variables and the condition check which decides that the value entered should be greater than 0.
  • So to states, the condition will false there needs some increment operation which states the condition variable will be false. So there must be an operation for "numItems" variables because it participates in the condition of the while loop.
  • The operation relates to the "numItems" variable is given only in option D. Hence D is the correct option while the other is not because others do not hold the operation for "numItems" variables.
You might be interested in
Who was the first person to make a portable computer?
Bad White [126]
It was invented by Osborne<span> Computers</span>
8 0
4 years ago
you're adding new wires in your building for some new offices. the building has a false ceiling that holds the lights and provid
AlladinOne [14]

Based on the above, the  type of cable that need to be used by you is option B) Plenum rated cable.

<h3>What is plenum rated cable mean?</h3>

Plenum rated cable is known to be a kind of a cable that tends to have a unique form of insulation that is known to have low smoke and low flame attribute.

Note that the Plenum cable is one that need to be installed in any "air handling" space and as such, Based on the above, the  type of cable that need to be used by you is option B) Plenum rated cable.

Learn more about cable from

brainly.com/question/13258934

#SPJ1

See full question below

You are adding new wires in your building for some new offices. The building has a false ceiling that holds the lights and provides an air path for heating and air conditioning. You would like to run your Ethernet cables in this area. Which type of cable must you use?

A) STP cables

B) Plenum rated cable

C) Cat 5e or Cat 6a cables

D) PVC jacketed cables

E) Fiber optic cables

6 0
1 year ago
What's the maximum number of ad extensions that can show for a particular query or device at any given time?
krok68 [10]

Answer:

Four (4) extensions.

Explanation:

Go-ogle Ads can be defined as a strategic advertising platform designed and developed by Go-ogle for use over the internet. It can be used to display product listings, services and campaigns to any web user over the internet.

Basically, for those who are relatively new to the Go-ogle Ads, the company provides a feature known as the dynamic search ads which helps various users to easily run a successful ad campaign. Through the use of machine learning, a dynamic search ad allows phrases and titles associated with a website to be automatically indexed and presented as a landing page to any user who is searching with the keywords.

The maximum number of ad extensions that can show for a particular query or device at any given time is four (4) extensions. The Go-ogle Ad extension platform is designed to display all the ads simultaneously or co-trigger and as such, the maximum number of ad extensions that are displayed per query or device are four (4).

4 0
3 years ago
What is spam? a type of virus that spreads from computer to computer through a network connection a type of virus that targets p
Bas_tet [7]

Answer:

This is a pretty obvious answer.

An unwanted e-mail sent in bulk from people or organizations.

Explanation:

8 0
3 years ago
You can restore an event you deleted by mistake in Calendar by ______.
andre [41]

Answer:

1.Clicking on the event date and adding it again

3 0
3 years ago
Other questions:
  • Which type of network medium is used by an integrated services digital network adapter?
    14·1 answer
  • Beverly is creating a website for her new clothing company. Aside from including photographs, how can she use the index page to
    8·2 answers
  • Natalie is a secretary and must complete a large amount of filing this afternoon. At 1:00 PM, the office receptionist gets sick
    10·1 answer
  • How to interchange first half of the array with second half of array in python?
    9·1 answer
  • Construct pseudocode for a program that prints ‘Hello World’ on the screen.
    7·2 answers
  • If you want to insert a table which ribbon should you select
    13·2 answers
  • If your organization hires a new employee, what would you do to create a user account in the Linux system and add the account to
    11·1 answer
  • Ye lust, and have not: ye kill, and desire to have, and cannot obtain: ye fight and war, yet ye have not, because ye ask not.​
    15·1 answer
  • Write a line of code that declares a variable called shipName and set it equal to the string SpaceX3000.
    9·1 answer
  • The sign used for closing a tag is​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!