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
Ahat [919]
3 years ago
9

considering that two variables counters and accumulators are important in loop design. What would be their purpose?

Computers and Technology
1 answer:
almond37 [142]3 years ago
5 0

Answer:

Counters are used to run the loop.

Accumulators are used to calculate and store the result.

Explanation:

In loops variables counters and accumulators are very important.The counter variable is used to increase the loop or move to the next iteration.

The accumulator variable is used to calculate and store the result of an operation in the loop.

For example:-

int i=0;

int sum=0;

while(i<7)

{

     sum=sum+i;

     i++;

}

In this while loop the counter variable is i and the accumulator variable is sum.Without the counter variable is not increased the loop will keep looping over the same value of i that is 0.

In the loop the accumulator variable sum is used to calculate the sum of integers form i=0 to 6.

You might be interested in
Q: Why can't I log in to Brainly
algol13

Answer:

yes you are probably on a school Chromebook

Explanation:

5 0
3 years ago
Adassadad saflalfaklfajfklajfalkfjalkfjalkfalkf
BlackZzzverrR [31]

Answer:

this belongs on r/ihadastroke

Explanation:

5 0
3 years ago
Read 2 more answers
Which version of Windows was considered an operating environment rather than an operating system?
maksim [4K]
The answer is A. Windows 1.O
4 0
4 years ago
The set of instructions given to a computer is called _____________________.
adell [148]

Answer:  c) a program.

Explanation:

A computer, is a hardware device, that differs from those with dedicated hardware (like a TV set, a radio, or an old phone) , in that it can be used for different purposes, due to it's a programmable device.

The way in which the computer is instructed to do anything, is by means of a set of instructions to  be read and executed sequentially, which is called a program.

The set of the different programs stored in the computer is which is known as the computer software.

4 0
3 years ago
Write a program that computes and prints the average of the numbers in a text file. You should make use of two higher-order func
lara [203]

Answer:import functools

# open your file

file = open("integers.txt", 'r')

file = file.read()

# put numbers into a list

file = file.split()

# convert list into integers

file = list(map(int, file))

# use lambda function to get average.

print(functools.reduce(lambda x, y: x+y / len(file), file, 0))

Explanation:

4 0
3 years ago
Other questions:
  • What is the name for the individual sections of the ribbon in PowerPoint 20162
    8·1 answer
  • The Fully Meets rating should be assigned when the spelling suggestion matches query intent
    11·1 answer
  • You have been contracted by a local school to evaluate their computer labs for security threats. They are most worried about the
    6·1 answer
  • On a spreadsheet, this is the term for a grouping of cells that touch each other and form a rectangle. An example of it would be
    13·1 answer
  • Write a function called activity which takes an integer parameter X that does the following:
    6·1 answer
  • Which of these is a method of selecting multiple items in Impress or PowerPoint? A. holding down the Ctrl key while clicking ite
    9·2 answers
  • How do you activate the Formula AutoComplete function of Excel 2016?
    15·2 answers
  • Which of the following extends a network over a large geographic area by connecting local area networks together?
    14·2 answers
  • Write a Java class with the following methods: getArray(int numStrings) is an instance method that takes command line input (use
    11·1 answer
  • Use the drop-down menus to complete each sentence.
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!