Using java, This program should read in a two-digit integer from the command-line and print out the sum of its digits. The program should use a method sumOfDigits() that takes a two-digit integer as an input and prints out the sum of its digits. The main should only read in the run argument, translate it to an int, and call the method sumOfDigits() with that integer as an input. =================================== e.g. Given a command-line argument 77, your program should output: Your number is 77. The sum of its digits is 14. and given a run argument 39, your output should be: Your number is 39. The sum of its digits is 12.
Using java, This program should read in a two-digit integer from the command-line and print out the sum of its digits. The program should use a method sumOfDigits() that takes a two-digit integer as an input and prints out the sum of its digits. The main should only read in the run argument, translate it to an int, and call the method sumOfDigits() with that integer as an input. =================================== e.g. Given a command-line argument 77, your program should output: Your number is 77. The sum of its digits is 14. and given a run argument 39, your output should be: Your number is 39. The sum of its digits is 12.
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 1PE
Related questions
Question
Using java, This program should read in a two-digit integer from the command-line and print out the sum of its digits. The program should use a method sumOfDigits() that takes a two-digit integer as an input and prints out the sum of its digits. The main should only read in the run argument, translate it to an int, and call the method sumOfDigits() with that integer as an input. =================================== e.g. Given a command-line argument 77, your program should output: Your number is 77. The sum of its digits is 14. and given a run argument 39, your output should be: Your number is 39. The sum of its digits is 12.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,