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
Your colleague received an E-mail from a bank that is requesting credit card and PIN number information. Which of the following
uysha [10]

Answer: A) Phishing

Explanation:

Phishing is type of attack in computer field that is processed to hack or steal the data of authorized user.The attacker acts as trusted party and then interacts with the authorized user through email or messages to gain  confidential information like pin code, credit card number, login details etc of that user.

  • According to the question, colleague is experiencing phishing as he has been requested for pin-code and credit-card number from a wrong source behaving as authorized bank.
  • Other options are incorrect because ransomware is attack that asks for ransom from authorized user for reviving their access. on system. Spoofing is falsifying as some other party to receive advantage.
  • Mail poisoning is inclusion of inappropriate details in email such as invalid email address etc.
  • Thus, the correct option is option(A).
0 0
3 years ago
Microsoft® Publisher does which of the following?
AVprozaik [17]

Answer:

Creates items using page layout skills

8 0
2 years ago
Read 2 more answers
. Generate 106 message bits (random binary values (bool/int) ). 2. Generate the corresponding code bits for r = 3, 5. This means
N76 [4]

Answer:

While loops are typically used when you don’t know how many times the loop needs to repeat. The body of the loop will repeat while the condition is true. The logical expression will be evaluated just before the body of the loop is repeated.

Let’s say that we want to find the square root of a number. For some square roots, you’re never going to be exact. Let’s say that we want to find a square root that, when multiplied by itself, is within 0.01 of the square we want. How do we do it? There’s a really old process that we can apply here.

Start by guessing 2.

Compute the guess squared.

Is the guess squared close to the target number? If it’s within 0.01, we’re done. We’ll take the absolute value of the difference, in case we overshoot. (In Python, abs is the absolute value function.)

If it’s not close enough, we divide the target number by our guess, then average that value with our guess.

That’s our new guess. Square it, and go back to Step #3.

Explanation:

7 0
3 years ago
A student is going to give a multimedia presentation comparing the novel The Wizard of Oz by L. Frank Baum to the 1939 movie ver
Alekssandra [29.7K]

Answer:

C.

Explanation:

A line graph can show how both the movie and the novel are compared to each other. It can give a visual of both mediums of the story rather than one or the other. Hope this helped :)

3 0
3 years ago
Read 2 more answers
What are the risks associated with this kind of connectivity?.
Eva8 [605]

Answer:

The risks associated with this kind of connectivity are that online hackers may see your information and that makes the human race too dependent on robots and technology which is never a good thing.

Explanation:

<h3>be happy</h3>
8 0
2 years ago
Other questions:
  • Which of the following best describes a toolbar?
    9·1 answer
  • 0001 0000 1100 0011 (unsigned, that is, interpreted as b2u)i.8 bit truncated value:ii.does the value change when truncated to 8
    7·1 answer
  • Jennifer's company currently uses Windows Active Directory to provide centralized authentication, authorization, and accounting
    14·1 answer
  • With microprocessors, The integration of a whole _____ onto a single chip or on a few chips greatly reduced the cost of processi
    14·1 answer
  • COMPUTER SCIENCE:PIXELS
    5·1 answer
  • "Create a Matlab Scrapt that will take the a Matrix A and Matrix B (of AX=B), then calculate the Determinant of Matrix A, Invers
    5·1 answer
  • You are a network engineer tasked with performing a site survey for a multiple-channel architecture (MCA) system in a three-stor
    11·1 answer
  • Write a program that takes a list of integers as input. The input begins with an integer indicating the number of integers that
    8·1 answer
  • PLZ HELP I AM TIMED!!!!
    11·2 answers
  • Draw the 2-3 tree that results when you insert the keys E A S Y Q U T I O N in that order into an initially empty tree
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!