Question: JAVA Design and implement a program (name it SumDigits) to compute the sum of all digits in an integer number. The program defines the following
JAVA
Design and implement a program (name it SumDigits) to compute the sum of all digits in an integer number. The program defines the following method:
Method sumDigits (int number) returns the sum of all digits in number.
In the main method, prompt the user for an integer input and pass the input to method sumDigits() to obtain the sum of its digits. Then display the entered number followed by the sum of its digits as shown below. Document your code and properly label the input prompt and the outputs as shown below.
Sample run 1:
You entered: 12345
Sum of digits: 15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
