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
spin [16.1K]
3 years ago
8

Write a java program which uses methods for calculating the sum of any 5 non-zero integer digits that are input. The program mus

t use scanner for input of the 5 digits. Two Methods must be used, one for calculating the sum of the 5 digits
Computers and Technology
1 answer:
zheka24 [161]3 years ago
3 0

Answer:

public class num1 {

   public static void main(String[] args) {

   //Calling the method Calculate

       calculate();

   }

//Method Calculate

   public static void calculate() {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter five numbers greater than 0");

       int sum =0;

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

           System.out.println("Enter the "+(i+1)+" number");

           sum+=in.nextInt();

       }

       System.out.println("The sum of the five numbers is: "+sum);

   }

}

Explanation:

  • Two Methods are created in Java Programming Language
  • The main method and the method calculate()
  • The calculate method uses a  for loop to request users to enter five numbers
  • Every number entered is added to the sum initially set to 0
  • The sum is printed at the end
  • In the main method, calculate is called.
You might be interested in
What are some of the challenges of note-taking? Check all that apply.
Anvisha [2.4K]

Explanation:

it can take up a great deal of time in class.

it can be distracting in the middle of a lecture.

it can cause the student to miss information.

3 0
4 years ago
Read 2 more answers
(TCO B) The symbol shown as a three-sided box that is connected to the step it references by a dashed line is what?
belka [17]

Answer: annotation symbol

Explanation:

The symbol shown as a three-sided box that is connected to the step it references by a dashed line is referred to as the annotation symbol.

The annotation symbol is referred to as a flowchart symbol that is used to hold comments. It is a tag that's applied to a family so that the family can be identified in a project.

4 0
3 years ago
azure claims there are 54 regions. but when i create my account, i can only see 30 or so. what happened to the other regions?
stira [4]

Explanation:

Some regions may not have the full suite for the utilization of the Microsoft Azure platform or they may possess limited capabilities for them to fully function.

6 0
3 years ago
Design a program that asks the user for a series of names (in no particular order). After the final person’s name has been enter
masya89 [10]

Answer:

size = int(input("How many names will be there? "))

names = []

for _ in range(0, size):

   name = input("Enter a name: ")

   names.append(name)

names.sort()

print(names[0] + " " + names[-1])

Explanation:

* The code is in Python

- Ask the user for the number of the name

- Initialize an empty list that will hold the name entered

- Inside the for loop, get the names and put them in the names array

- When all the names are entered, sort them and print the first and last of the name

8 0
3 years ago
Clifford created a table using OpenOffice Writer and entered some information into the table. Later, he needed to add rows into
Stels [109]
I m pretty sure its A . the size section of the insert table dialog box 
7 0
4 years ago
Other questions:
  • ?trophic levelNYIGVU.;/IO9YK7,'0;
    12·1 answer
  • Drag the tiles to the correct boxes to complete the pairs. Match the tools that you can use while solving a problem with their c
    6·2 answers
  • "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen
    10·1 answer
  • Can anyone drink and drive safely?
    13·2 answers
  • When using a presentation software you can change the size of the text to...? Increase Font size, Decrease font size, increase t
    15·2 answers
  • HELP PLS TIME LIMIT HERE
    11·1 answer
  • 12. How many different documents can<br> you have open at one time?
    8·1 answer
  • HTML code to display square bullets in an unordered list​
    7·1 answer
  • Carmen has met new people online that she enjoys talking to. One of these people has asked her to meet at the park in person and
    15·1 answer
  • How to view average for an assignment in gradebook in canvas.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!