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
what is internet ?? mention five ways one can use the internet profitably. state five disadvantages of the internet.​
rosijanka [135]

The Internet can be best described as network of networks since it connects over 50 million computer worldwide.

3 0
3 years ago
I need help... Simple java
OLga [1]

Answer: you need to  add the numbers instead  of the letters depending on the  question

Explanation:

5 0
3 years ago
write a function issorted() that accepts an array of real numbers arr and an integer n as arguments, where n is the size of arr.
lesantik [10]

Answer:

Here is code in java.

import java.util.*;

class Main

{

//main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

       int m;

        // scanner object to read input from user

       Scanner ss=new Scanner(System.in);

       System.out.println(" size  of the array:");

       //read the size of the array

        m=ss.nextInt();

        // create array of the given size

        float arr[]=new float[m];

        /* call function to check whether input are in the ascending sorted order or not */

        Boolean res= issorted(arr,m);

       

      // print the result

       System.out.println("array in the ascending sorted order  : "+res);

     

       

   }catch(Exception ex){

       return;}

}

 // function to check whether input are in the ascending sorted order or not

public static boolean issorted(float[] arr,int n)

{

    int i,j;

    float d;

    Boolean flag=true;

    Scanner ss=new Scanner(System.in);

    System.out.println("enter the elements of the array:");

     // read elements of the array

    for(i=0;i<n;i++)

    {

        arr[i]=ss.nextFloat();

    }

   

    // check elements re in the ascending order or not

    for(j=0;j<n-1;j++)

    {

        if(arr[j]>arr[j+1])

        {

            flag=false;

            break;

        }

    }

     // return the result

    return flag;

}

}

Explanation:

With the help of scanner class object, read the size "m" of array.Create an array of  the given size. Pass array and integer into the function issorted(). Read the elements of the array and then check elements are in the ascending order or not.It will return "true" if elements are in the sorted order else it will return "false".

Output:

enter  size  of the array:                                                                                                                                    

5                                                                                                                                                              

enter the elements of the array:                                                                                                                              

1 2 3 4 7                                                                                                                                                      

array in the ascending sorted order  : true                                                                                                                              

enter  size  of the array:                                                  

5                                                                            

enter the elements of the array:                                              

2 4 9 3 5                                                                  

array in the ascending sorted order  : false

7 0
4 years ago
Which of the following statements is incorrect? An operating system provides an environment for the execution of programs. An op
rosijanka [135]

Answer:

command line and graphical user interface

Explanation:

there were (and still are) operating system with no graphical user interface at all, as for example some Unix releases

8 0
3 years ago
Differentiate between native and hybrid apps​
patriot [66]
Basically, a hybrid app is a web app built using HTML5 and JavaScript, wrapped in a native container which loads most of the information on the page as the user navigates through the application (Native apps instead download most of the content when the user first installs the The native applications are created for a particular platform either Android or iOS, whereas the hybrid development process relies on cross-platform functioning. ... The developers deal with one core code that covers both platforms. Therefore the development process is the main difference between native and hybrid apps.

Pls mark me as brainliest :)
6 0
3 years ago
Other questions:
  • 11) Write the definition for a child class of Circle named Cylinder. The cylinder should have a double attribute named height. T
    12·1 answer
  • If you ask a question on this website, how do the points work? Meaning, the points that you set for the person who answers, does
    14·1 answer
  • According to the text, ________________, although not considered a crime, is viewed as a grave public wrong in many jurisdiction
    10·1 answer
  • You are building a gaming computer and you want to install a dedicated graphics card that has a fast GPU and 4GB of memory on bo
    10·1 answer
  • which of these variable declarations will the variable remain uninitialized unless it is explicitly initialized?1)Declaration of
    5·1 answer
  • True or false Encryption prevents hackers from hacking data?
    8·1 answer
  • All who are interested in forex trading and bitcoin mining follow me for account management to all who are busy with work so i c
    14·1 answer
  • Pls answer this
    5·1 answer
  • What is the best way of farming exotics in destiny?
    12·2 answers
  • (Find the number of uppercase letters in a string) Write a recursive function to return the number of uppercase letters in a str
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!