possiblylethal wrote:I believe many people here are making the questions 10x harder than they need to be.
"Make sure the number (string) is a three digit number."
Note: That the number passed in is a string (this must be true because c.readLine() takes in a string). There is no need to turn this string into an integer yet.
Ask the string how long it is. No need to complicate things. note: strings start at 0!
Bonus: the user could enter in a 3 letter word instead of a number. How would you ask a string to see if any/all characters in the string are letters or numbers or !@#$%^&*()_+\ ect.
"Reverse the original number (string)"
There are many fun ways to do this. I think the most basic way would be to create a new string.
"Subtract the reverse from the original"
Probably easiest way is to now convert the string into an integer and save into an int (www.google.com) then subtract them.
"Reverse a second time the resulting number"
See above. Man, it would be nice if you didnt have to do this twice and could just pass it into a function that spits it out.
"Add it to un-reversed form and display"
Grab the un-reversed form, convert to integer, save into in, display into console however you do that with "Console"
add me if you need any more help
as someone who is in a highschool java class, the purpose of assignments like these are to teach you how to use ints/loops ect... Once you can do stuff like this they teach you the simpler and easier ways to do them