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]
2 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]2 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
Fill in the blank with the correct response.
harina [27]

Answer:

program

Explanation:

6 0
2 years ago
IN PYTHON LANGUAGE
shtirl [24]

favorite_color = input("Enter favorite color:\n")

pet = input("Enter pet's name:\n")

num = input("Enter a number:\n")

print("You entered: "+favorite_color+" "+pet+" "+num)

password1 = favorite_color+"_"+pet

password2 = num+favorite_color+num

print("First password: "+password1)

print("Second password: "+password2)

print("Number of characters in "+password1+": "+str(len(password1)))

print("Number of characters in "+password2+": "+str(len(password2)))

This works for me.

8 0
2 years ago
Read 2 more answers
Is this good enought to record and edit in 4k UHD? (Ultra High Definition)
vekshin1

Answer:

It should be, yes

Explanation:

5 0
3 years ago
Read 2 more answers
Create a flowchart that assigns a counselor to a student.
Nataly [62]
Please Help! Unit 6: Lesson 1 - Coding Activity 2
Instructions: Hemachandra numbers (more commonly known as Fibonacci numbers) are found by starting with two numbers then finding the next number by adding the previous two numbers together. The most common starting numbers are 0 and 1 giving the numbers 0, 1, 1, 2, 3, 5...
The main method from this class contains code which is intended to fill an array of length 10 with these Hemachandra numbers, then print the value of the number in the array at the index entered by the user. For example if the user inputs 3 then the program should output 2, while if the user inputs 6 then the program should output 8. Debug this code so it works as intended.

The Code Given:

import java.util.Scanner;

public class U6_L1_Activity_Two{
public static void main(String[] args){
int[h] = new int[10];
0 = h[0];
1 = h[1];
h[2] = h[0] + h[1];
h[3] = h[1] + h[2];
h[4] = h[2] + h[3];
h[5] = h[3] + h[4];
h[6] = h[4] + h[5];
h[7] = h[5] + h[6];
h[8] = h[6] + h[7]
h[9] = h[7] + h[8];
h[10] = h[8] + h[9];
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
if (i >= 0 && i < 10)
System.out.println(h(i));
}
}
4 0
2 years ago
Read 2 more answers
What are the events?
erastovalidia [21]

Answer:

a thing that happens or takes place, especially one of importance.

8 0
3 years ago
Other questions:
  • Is a protocol that allows users to log on to and access a remote computer?
    8·1 answer
  • Make the correct match.
    11·1 answer
  • Consider the following general code for allowing access to a resource:
    13·1 answer
  • Bill downloaded an antivirus software from the Internet. Under the Uniform Commercial Code (UCC), the software is a: Select one:
    15·1 answer
  • Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bits memory address r
    9·1 answer
  • 6. Why did he choose to install the window not totally plumb?
    13·1 answer
  • The function below takes two arguments, a dictionary called dog_dictionary and a list of dog names (strings) adopted_dog_names.
    8·1 answer
  • Binary is a base-2 number system instead of the decimal (base-10) system we are familiar with. Write a recursive function PrintI
    10·1 answer
  • Spam and i report
    14·2 answers
  • A radio and communications security repairer is responsible for both radio and satellite communication systems.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!