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
What is a browser cookie?
nikitadnepr [17]

B) its a small peice of data that tracks your preferances on diffrent websites

Have a great day !

6 0
3 years ago
Read 2 more answers
The user does not need to highlight data within an Excel worksheet in order to remove conditional formatting. True or false
san4es73 [151]

True

Excel 2019 makes it easy to remove conditional formatting since users do not need to highlight data in order to remove it.

5 0
4 years ago
Halp Computer Science
AleksandrR [38]

1st one: is memory

2nd one: is 8

8 0
3 years ago
Read 2 more answers
What was the first portable computer called and who made it?
jekas [21]
It was the Osborne 1 made by Adam Osborne in 1981.
6 0
3 years ago
What is meant by byte in computer terminology​
dsp73

Answer:

Byte, the basic unit of information in computer storage and processing. A byte consists of 8 adjacent binary digits (bits), each of which consists of a 0 or 1. The string of bits making up a byte is processed as a unit by a computer; bytes are the smallest operable units of storage in computer technology.

Explanation:

Can I be brainliest? TYSMMMMMM      

7 0
3 years ago
Read 2 more answers
Other questions:
  • If you need to show slides on a wide-screen monitor, you might change their size to: Select one: a. Onscreen Show (16:9) b. Onsc
    11·1 answer
  • Who wants sum points? spam this and ill put 3 questions up for 100 points i have 7111 points rn
    7·2 answers
  • 7.
    15·1 answer
  • Vicky is investigating multiple hacking attempts on her cloud-based e-commerce web servers. She wants to add a front-end securit
    5·1 answer
  • Given two strings s and t of equal length, the Hamming distance between s and t, denoted dH(s,t), is the number of corresponding
    6·1 answer
  • How to enter date in a Date/Time field?​
    8·1 answer
  • Why do we need to learn about engineering and technology?
    6·1 answer
  • Why won't Brainly let me create an account? I have tried many times but it just loads.
    8·1 answer
  • How can i find these services
    10·1 answer
  • Two types of storage memory​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!