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
When giving a presentation it is better to ___________
Romashka-Z-Leto [24]
<span>C) Always better to give your information and end on time.</span>
6 0
3 years ago
A person you respect who offers you advice and assistance is known as a(n) _____.
Archy [21]
This would be a mentor-D. They role is to mentor or guide you with advice or assistance. A role model is a similar answer in that they respect you, but they might not offer advice or assistance which makes it incorrect.
7 0
2 years ago
Please help me with this! I’m using Python 3
IgorLugansk [536]

Something like this?

h1 = int(input())

m1 = int(input())

s1 = int(input())

h2 = int(input())

m2 = int(input())

s2 = int(input())

s = h2*3600 + m2*60 + s2 - (h1*3600 + m1*60 + s1)

print(s)

3 0
2 years ago
Which of the following is NOT essential for individuals to have to build their own web page?
natali 33 [55]
Linux. You do not need Linux as an operating system for your website.
5 0
3 years ago
What is the full form of GUI​
Nonamiya [84]

Answer:

The graphical user interface (GUI /dʒiːjuːˈaɪ/ jee-you-eye or /ˈɡuːi/) is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfaces, typed command labels or text navigation.

4 0
3 years ago
Read 2 more answers
Other questions:
  • A ____ is harmful computer code that spreads without your interaction, slipping from one network to another and replicating itse
    15·1 answer
  • What type of document would you use the landscape page orientation
    7·1 answer
  • High-speed memory that reduces the frequency of access by the cpu to conventional memory is called
    12·1 answer
  • Write an expression that computes the average of the values 12 and 40.
    6·1 answer
  • Is backing up computer files done on the hard drive?
    14·2 answers
  • Project manager George is defining project management to his team. How should he define project management in one sentence?
    7·1 answer
  • How do you get a crown on this website<br> look under your points on the right side of your picture
    15·2 answers
  • Many bookstores have closed since the rise of the Internet. What type of
    11·1 answer
  • How to beat level 50 in give up robot 2
    5·1 answer
  • What is algorithm and how does it works​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!