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
never [62]
3 years ago
11

The counter variable in the code below increments by 1 each time through the loop. What will the value of counter be after the f

ollowing loop executes?
var counter = 0;
var n = 6;
while(n > 0){
n = n - 2;
counter = counter + 1;
}
console.log(counter)
4

A. 0
B. 1
C. 2
D. 3
E. 4
Computers and Technology
1 answer:
Novosadov [1.4K]3 years ago
8 0

Answer:

The Value of the variable counter will be 3

Explanation:

The code snipped given in the question will execute only three times.

The value of counter will be increased by 1 afer each execution with the initial value of counter set to 0

The condition while n>0 will hold true at the first iteration when n=6. (counter will be increased to 1) and n is reduced by 2 (new value of n =4).

The condition while n>0 will hold true at the second iteration when n=4-2 =2. (counter will be increased to 2) and n is reduced by 2 (new value of n =2).

The condition while n>0 will hold true at the third iteration when n=2-2. (counter will be increased to 3) and n is reduced by 2 (new value of n =0).

At the fourth iteration, the condition becomes false as the value of n is now zero and 0 is not greater than 0. So the the condition becomes false with the value of counter = 3

You might be interested in
Object Linking and Embedding (OLE) data integration allows you to
worty [1.4K]
Hey mate thanks for letting me help you

l just look into this and l got this A set of APIs to create and display a (compound) document, but that is not a choice. so <span>D. edit data in a plain text editor
</span><span>
hope l helped   
</span>
4 0
3 years ago
One concern some users have about storing data or accessing applications in the cloud is .
andriy [413]

Answer:

Explanation:

Security is the primary concern about cloud computing. This is the main for many IT departments to refrain from using cloud computing. Some things that put the security of cloud computing to be concerned are: Theft or loss of intellectual property.

3 0
2 years ago
The shipping charges per 500 miles are not prorated. For example, if a 2-pound package is shipped 550 miles, the charges would b
Sedbober [7]

Answer:

The solution code is written in Python:

  1. COST_PER_500MI = 1.1
  2. weight = float(input("Enter weight of package: "))
  3. total_cost = weight * COST_PER_500MI
  4. print("The shipping charges is $" + str(round(total_cost,2)))

Explanation:

Based on the information given in the question, we presume the cost per 500 miles is $1.10 per pound ($2.20 / 2 pound).

Create a variable COST_PER_500MI to hold the value of cost per 500 miles (Line 1). Next, prompt user input the weight and assign it to variable weight (Line 3). Calculate the shipping charge and display it using print function (Line 4-5).

4 0
3 years ago
Now it says this and the airplane mode option is dull
AnnyKZ [126]

Explanation:

Click the airplane mode again and see if your internet turns back on. if not then click the internet symbol and check to see why its down.

7 0
3 years ago
Read 2 more answers
Technologies that allow for instant worldwide communication include satellite and computer systems. mobile phones and internet a
maw [93]

Technologies that allow for instant worldwide communication include mobile phones and internet access. Cell phones , wireless devices  and smart phones are technologies that have made global communication instant and more effective.

The internet and the development of digital technology (computer-based technology) in particular, have made the most significant impact on globalization.

3 0
2 years ago
Read 2 more answers
Other questions:
  • Software obtained illegally is called open-source software. true / false
    15·1 answer
  • Approximately what percentage of the world population owns a smartphone?
    9·1 answer
  • Virtualization:
    8·1 answer
  • You are part of a team that is setting up a movie streaming service. The company is planning on initially making available 500 m
    8·1 answer
  • Which field of study would be most useful for a person who wants to work in a recycling plant?
    12·2 answers
  • When you touch a hot stove, along which pathway will the impulses travel and what is the final destination in the cns?
    12·1 answer
  • Employers can use spyware to track program usage by employees.
    12·1 answer
  • Match the following pls help
    5·1 answer
  • What distinguishes Accenture as a holistic provider of Extended Reality (XR) services?.
    9·1 answer
  • You have a filtered dataset for Customer Sales with some null value rows. You want to remove these rows completely. How will you
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!