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
Alexeev081 [22]
3 years ago
14

A. Post-It note b. notebook c. tutor d. spell check

Computers and Technology
1 answer:
Ostrovityanka [42]3 years ago
4 0
What is this for? like what is the question?


You might be interested in
Write a method that computes the sum of the digits in an integer. Use the following method header: public static int sumDigits(l
kifflom [539]

Answer:

The java program for the given scenario is shown below.

import java.util.*;

import java.lang.*;

public class Test

{

   //variables to hold the number, digits and sum of the digits

   //variable to hold number is assigned any random value

   static long num=123;

   static int sum=0;

   static int digit;

   static int s;

   //method to add digits of a number

   public static int sumDigits(long n)

   { do

       {

           digit=(int) (n%10);

           sum=sum+digit;

           n=n/10;

       }while(n>0);

       return sum;

   }

public static void main(String[] args) {

    s = sumDigits(num);

 System.out.println("The sum of the digits of "+num+ " is "+s);  }

}

OUTPUT

The sum of the digits of 123 is 6

Explanation:

1. The variables to hold the number is declared as long and initialized.

2. The variables to store the digits of the number and the sum of the digits are declared as integer. The variable, sum, is initialized to 0.

3. The method, sumDigits(), is defined which takes a long parameter and returns an integer value. The method takes the number as a parameter and returns the sum of its digits.

4. Inside method, sumDigits(), inside the do-while loop, the sum of the digits of the parameter is computed.

5. Inside main(), the method, sumDigits(), is called. The integer value returned by this method is stored in another integer variable, s.

6. The sum of the digits is then displayed to the console.

7. All the variables are declared outside main() and at the class level and hence declared static. The method, sumDigits(), is also declared static since it is to be called inside main().

8. In java, the whole code is written inside a class since java is a purely object-oriented language.

9. In this program, object of the class is not created since only a single class is involved having main() method.

10. The program can be tested for any value of the variable, num.

11. The file is saved as Test.java, where Test is the name of the class having main() method.

7 0
3 years ago
1. which of the following tools can be used to mesure mass. (answer = 5 +??? points)
krek1111 [17]
B. a triple-beam balance
4 0
3 years ago
Read 2 more answers
A computer on a network that is not the server​
katrin [286]

Answer:

A peer-to-peer network is one in which two or more PCs share files and access to devices such as printers without requiring a separate server computer or server software. ... A P2P network can be an ad hoc connection—a couple of computers connected via a Universal Serial Bus to transfer files.

5 0
2 years ago
What is the difference between a manufacturing engineer and a materials engineer?
lyudmila [28]
<span> a </span>manufacturing<span> or industrial </span>engineer<span> are mechanical </span>engineers<span> with ... Process </span>Engineers<span> specialise in processes where raw </span>materials<span> are converted using chemical processes resulting in significantly </span>different<span> ...</span>
7 0
3 years ago
Read 2 more answers
To change the backround color of a page, which tab would you use?
ivann1987 [24]
I have concluded the answer is a
4 0
3 years ago
Read 2 more answers
Other questions:
  • Part 1: Create an application that allows you to enter student data that consists of an ID number, first name, last name, and gr
    14·1 answer
  • Whereas lines of competition are clearly defined in the more established industries, in the Internet industry they are blurred a
    9·1 answer
  • Hello, can you help me answer these questions?
    9·2 answers
  • Write a program that will print out statistics for eight coin tosses. The user will input either an "h" for heads or a "t" for t
    14·1 answer
  • Customizing ads to people who had earlier visited the site is
    14·1 answer
  • A laptop gets recycled by an e-waste recycling company once it can't be used anymore. Which stage of the hardware lifecycle does
    7·1 answer
  • IN WHICH COUNTRY DO THEY LET YOU PLAY MINECRAFT IN SCHOOL?
    8·2 answers
  • Me Completan Pliiiis
    10·2 answers
  • What is the diffrent between ibm pc and ibm compatibles in table:​
    11·1 answer
  • You need to know more than just facts in order to use critical thinking skills.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!