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
Nimfa-mama [501]
3 years ago
7

Write a for loop that runs 5 times and accepts the input of an integer number every time. Those numbers will be accumulated by a

variable called total.
Computers and Technology
1 answer:
eduard3 years ago
7 0

Answer:

import java.util.Scanner;

public class num2 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int total = 0;

       for(int i=0; i<5; i++){

           System.out.println("Enter next Int: ");

           total = total+in.nextInt();

       }

       System.out.println(total);

   }

}

Explanation:

In the code above written in Java programming language, the for loop statement for(int i=0; i<5; i++) ensures that the loop goes from 0-4 a total of five times.

At each iteration it requests a user to enter an int. The number entered is stored in the variable total which is initially assigned 0.

When the loop finishes execution, total is printed out

You might be interested in
Please help explain this calculator code.
goblinko [34]

Answer:

i dont know ask the calc to do it. hehe

Explanation:

7 0
3 years ago
Which shortcut key combination will move the cursor to the beginning of the line?
Lina20 [59]

Answer:

Home Key

Explanation:

To move the cursor to the beginning of line:

Press `HOME` button on keyboard

5 0
3 years ago
Suppose that the five measured SampleRTT values are 106 ms, 120 ms, 140 ms, 90 ms, and 115 ms.
jeyben [28]

Answer:

a) 100.75,   103.15,    107.756,    105.536,   106.72

b) 5.06,    8,       14.061,       14.43,    12.89

Explanation:

Measured sample RTT values : 106 ms, 120 ms, 140 ms,  90 ms,  115 ms

First estimated RTT value = 100 ms

∝ = 0.125

β = 0.25

First DevRTT value = 5 ms

<u>A)   Compute the EstimatedRTT after each of these SampleRTT values is obtained,</u>

Formula for estimated RTT = ( 1 - ∝ ) . estimated RTT + ∝.sample RTT

B). <u>Compute  the DevRTT after each sample is obtained,</u>

Formula for DevRTT = ( 1 - β ) . DevRTT + β. | sample RTT - Estimated RTT |

attached below is a detailed solution

5 0
3 years ago
A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
lorasvet [3.4K]
All data is stored in table
5 0
4 years ago
What is jcl language on the mainframe?
Pavel [41]
Job Control Language on the mainframe is the name for scripting language used on IBM mainframe operating system to instruct how to start a subsystem.
5 0
4 years ago
Other questions:
  • 1) Put the following in order from smallest to largest A) 1,500,000 bytes B) 2,000 kilobytes C) 0.01 petabytes D) 1 Terabyte E)
    8·1 answer
  • PLEASE HELP ME ASP!!!
    11·2 answers
  • ​In addition to joint application development, another popular user-oriented method is _____, which resembles a condensed versio
    14·1 answer
  • (count single digits) * write a program that generates 100 random integers between 0 and 9 * and displays the count for each num
    7·1 answer
  • You modify a document that is saved on your computer. Where are the changes stored until you save the document?a. Radom access m
    15·1 answer
  • The _____ is the button that you push to take a photograph. i think its B Help PLZ
    5·1 answer
  • Can you answer the fill in the blanks
    15·2 answers
  • Which category does this fall in identity theft​
    6·1 answer
  • What makes a computer a computer?​
    12·2 answers
  • Which of the following statement is true? Single choice. (2 Points) Views are virtual tables that are compiled at run time All o
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!