Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How would I start this?

807601Feb 2 2008 — edited Feb 3 2008
I just started taking an Intro to Java class, it's my very first program class, I don't quite understand much of it yet, but I'm hoping things will click. Can someone give me some advice or examples on how to do something like this?

Write a Java program that asks to input an integer between 0 and 999 and then add all the digits in the integer, then output the sum of all the digits. For example, if the input is 932, the output is "9 + 3 + 2 = 14"; and if the input is 2156 or -57, the output is "the input is not between 0 and 999. "Please enter your integer again." The program should be able to handle non integer exceptions.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2008
Added on Feb 2 2008
13 comments
201 views