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]
2 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]2 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 were the technological innovations that allowed for the rapid expansion of the railroads?
liraira [26]

Answer:

There are different phases of railroad expansion with the innovations in technology.

Explanation:

Few of the technological innovations are described below that leads in railroad expansion more rapid.

1. Centralized Traffic control (CTC) is introduced in 1960's that is used to control the traffic on railroads using different signal control.

2. In 1990's after computer technology involvement, railway ticket and reservation system is automate and being centralized. That makes the railroad expansion improve.

3. Bullet train technology has been introduced, that makes the railway trains more faster.

4. Electric trains has been introduced to use green energy and reduce the dependency on the fuel to make environment clean and green.

5 0
2 years ago
The first computer program was used to help the analytical engine calculate numbers. Who invented that program?
nikdorinn [45]

Answer:

Charles Babbage

Explanation:

Analytical engines were presumed to be the first general-purpose computer which was designed sometime in the 19th century by Charles Babbage -  a British mathematician and inventor. A series of punch cards was used by Charles Babbage in his design of the engine. These punch cards were used for various operations such as arithmetical operations, numerical constants and other operations such as load and store.

<em>Hope this works!</em>

8 0
3 years ago
Imagine that you work for a company directly related to your major. Your company is preparing for expansion and your boss, Ms. S
shutvik [7]

Answer:

start with what you know

Explanation:

6 0
2 years ago
Petra notices that there are a number of issues with a new fiber optic connection whose status appears to be going up and down c
DanielleElmas [232]

Fiber Internet is the wired choice of our present times. It has replaced traditional copper-based facilities.

<h3></h3>

How fiber optics are connected?

  • Fiber to the curb (FTTC) means your fiber connection goes to the nearest pole or utility box—not an actual concrete curb. After that, coaxial cables will send signals from the “curb” to your home. This means your connection is made up of part fiber-optic cables, part copper wires.
  • Twisted pair cabling simply refers to a wiring whereby two conductors that are gotten from a single circuit will be twisted together so that their electromagnetic compatibility can be enhanced.
  • This type of network cable is commonly used to connect office computers to the local network and it is used for Ethernet networks. A circuit is formed from the pair of wires which can be used in the transmission of data.
  • Fiber optic internet is a data connection carried by a cable filled with thin glass or plastic fibers. Data travels through them as beams of light pulsed in a pattern. Fiber optic internet speeds are about 20 times faster than regular cable at 1 Gbps.

To learn more about fiber refer to:

brainly.com/question/21808066

#SPJ4

5 0
10 months ago
Which example task should a developer use a trigger rather than a workflow rule for?
Komok [63]

Answer:

A. To set the primary contact on an account record when it is saved

Explanation:

After updating a Contact and then you set the Primary checkbox, the contact becomes the primary contact and this then updates the reference in the Parent Account. Triggers are used for this purpose and not workflow rule. In this case there is only one contact at a time that is set as Primary Contacts, and in the case where an Account does not have any Contacts, the first contact that is created is made the primary and the trigger sets that value in reference.

6 0
3 years ago
Other questions:
  • Write a program that requires the user to enter two floating-point numbers (num1 and num2) from the keyboard. Multiply them and
    6·1 answer
  • A low concentration of market power has positive affects. A low concentration of market share has which of the following effects
    7·1 answer
  • What are some of the causes for error 1921 when updating?
    11·2 answers
  • Adjusting the ______ adjusts the difference in appearance between light and dark areas of the photo.​
    10·2 answers
  • c++ Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is c
    14·2 answers
  • Which of the following cameras is a high-end digital camera that has interchangeable lenses and uses a mirror to display on its
    13·1 answer
  • Hat is the purpose of the domain name?
    7·2 answers
  • Which of these is NOT a mathematical operator used in Python?
    12·1 answer
  • 1. It is acceptable to use a jack that has been
    13·1 answer
  • When you hear the word “stress” what does it mean to you? How does stress affect you and what do you do to cope with stress
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!