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
Case Study/Scenario: First, Julio clicks Tools from the Chrome menu on the toolbar. Next, he looks for Manage Add-Ons but can no
Margarita [4]

Answer:

Follows are the solution to this question:

Explanation:

Throughout this scenario, Julio chooses the wrong way to handle the add-ons, instead, he opens the option to search and then type add-ons, where the manager can search for add-ons. It is a software extension that provides an application of additional features. It can broaden certain features, introduce additional features to just the interface surface, or provide extra capabilities for both the system.

4 0
3 years ago
9. Name at least two types of hard drives?
JulsSmile [24]
IDE: Integrated drive electronics

Sata:Serial advance technology attachment
5 0
3 years ago
Discuss briefly general-purpose graphicsprimitives that contain 2D graphics library.
Zina [86]

Answer:

  General purpose graphics primitives that contain 2D graphic library as, it is used in graphics processing unit which typically manage computation for computer graphics. Graphic primitives contain basic element such as lines and curves. Modern 2D computer graphic system that operate with primitives which has lines and shapes. All the elements of graphic are formed from primitives.

8 0
3 years ago
If you glare and grit your teeth while telling your friend that you're not frustrated, your nonverbal communication is _________
Maslowich

If you glare and grit your teeth while telling your friend that you're not frustrated, your nonverbal communication is contradicting your verbal communication.

3 0
3 years ago
In Microsoft Windows, which of the following typically happens by default when a file is "double-clicked"
Elenna [48]
Depending on the type of file, it normally runs or opens.
4 0
3 years ago
Read 2 more answers
Other questions:
  • What is code reuse meant to do?
    9·1 answer
  • What is one disadvantage of accessing the Internet through a public search engine such as Google or Yahoo?
    10·2 answers
  • What is after Windows 8.1
    11·2 answers
  • SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater th
    14·1 answer
  • Write a program that receives an character and displays its Unicode. Here is a sample run: Enter an character: E The Unicode for
    8·1 answer
  • What is the error in this?<br><br> userGuess = int(input(“Guess a number between 1 and 20: “))
    12·1 answer
  • How do you get off of the comments after you look at them wit out going all the way off the app?
    15·1 answer
  • Which of the following statements is true about the code used for software development?
    7·1 answer
  • I have the requirements for Ace rank on Brainly but hasn't given me it yet. Does it just take longer than normal ranks or someth
    15·2 answers
  • Everyone within a company needs to be aware of what data can do to improve business processes and how to make it happen. Which c
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!