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
Parts are described by partnum, color, and price. Parts can be subassemblies as well and this means that they contain other part
Degger [83]

Answer:

The answer is attached below

Explanation:

8 0
3 years ago
When long labels are required, which of these commands can you use to improve readability of a worksheet? .
kykrilka [37]
Whilst all the options presented can help improve readability of a worksheet, the best answer is B. Sort and Filter.

When working with very long tables, the sort and filter functions allow table data to be better organised to improve readability. You can sort by a criteria or filter out all data except what you are looking for.

Merge & centre and wrap text relate to text formatting in the cells themselves, these are useful features in general but not essential. Conditional formatting is a useful tool to highlight certain types of data, such as to colour the cell based on its value. Again, it is not as powerful as sort/filter.
3 0
3 years ago
Read 2 more answers
Jason is an aspiring filmmaker. He manages finance and makes sure that everyone is involved in the project. Which role is Jason
lana66690 [7]

Answer:

a film producer.

is the role he is playing

7 0
3 years ago
How do i voice record on my (acual ipod itself) ipod nano 4th generation helppppppp
Olenka [21]

Answer: it is called voice memo search it on your settings

Explanation:

3 0
3 years ago
Whats the difference between copying a file to my desktop and creating a shortcut?
hram777 [196]
When you copy a file to the desktop you are putting the actual file on the desktop whereas when you put a short cut on the desktop you are just placing a reference to where the file is actually located.
3 0
3 years ago
Other questions:
  • Pls help me. ask yourself what would jesus do...
    14·1 answer
  • What benefit does internet have​
    11·1 answer
  • A(n _______________ is a pre-written formula that is built into excel
    12·1 answer
  • Cheryl has several concepts for mobile apps for smartphones. A friend suggests that she develop her apps for an open-source oper
    13·1 answer
  • When creating a new user in linux, after entering the name, the username box:?
    9·1 answer
  • Running stop signs and lights is an blank that a driver may be operating their vehicle under the influence of drugs
    8·2 answers
  • Create an application named StudentsStanding.java that allows you to enter student data that consists of an ID number, first nam
    12·1 answer
  • What has happened (or is still happening) to make this speech occur? armageddon
    15·1 answer
  • One of the earliest computer networks was the ARPANET, developed in the early 1960s. The purpose of this network was to:
    13·2 answers
  • iv. Assuming the above operating system that cannot perform memory deallocation. Name at least three effects on the overall syst
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!