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
How many times should the start function be defined in a program?
tatyana61 [14]

Answer:

0 1 2 However many you like

✓ I think its 2x they will start to define the program

4 0
3 years ago
If an application written for an earlier version of Windows doesn't run correctly the operating system can emulate its own older
n200080 [17]

Answer:

The answer is b) Right-clicking the program icon, clicking Properties, and then applying the required settings on the Compatibility tab.

Explanation:

If you have to run an application on a specific operating system, you have to configure the compatibility by accessing in its Properties, then Compatibility tab, and configure the operating system properly.

7 0
3 years ago
If an individual receives 1.8 mGy while standing 4 ft from a source of radiation for 2 minutes, which of the following option(s)
erastovalidia [21]

Answer:

The answer is letter B.

Explanation:

The option that will most effectively reduce her or his radiation exposure to that source is Standing 8 ft from the source for 2 minutes.

6 0
3 years ago
The __________ endian storage format places the __________ byte of a word in the lowest memory address. The __________ endian st
mr Goodwill [35]

Answer:

i. Big

ii. most significant

iii. little

iv. most significant

Explanation:

8 0
3 years ago
Which of the following is the first step in the boot process? Select one: A. The BIOS checks that all devices are operational. B
dalvyx [7]

Answer:

D. The BIOS is activated by powering on the CPU.

Explanation:

The BIOS is activated by powering on the CPU is the first step in the boot process.

5 0
3 years ago
Other questions:
  • Programmers use _____ languages in the Rapid Application Development (RAD) methodology to facilitate code reuse?
    5·1 answer
  • A(n) ____ is a collection of one or more program statements combined to perform some action
    14·1 answer
  • When public relations professionals make provocative statements in newsgroups to get people to visit an organization's website o
    10·1 answer
  • Which tool is used to view stars in galaxies far from the Milky Way?
    10·1 answer
  • You manage a small LAN for a branch office. The branch office has three file servers and few client workstations. You want to us
    14·1 answer
  • Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original mai
    11·1 answer
  • The Operating System is used to locate, move, and copy files.
    10·1 answer
  • If you would like to give another user permissions on your mailbox or to particular folders within your mailbox, which role shou
    13·2 answers
  • nts/viewer/classes/289ef1a5d7c341c284010 Select the compound inequality shown on the graph. 5 4 3 2 1 0 1 2 를 4​
    6·1 answer
  • A group of two or more computer systems linked together via communication devices is called:.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!