ok this is what i'm supposed to do:
Write a program that reads a four-digit integer, such as 1998, and then displays it, one digit per line, like so:
1
9
9
8
I don't have any idea on how to even get started on this, any help would be appreciated.
Printable View
ok this is what i'm supposed to do:
Write a program that reads a four-digit integer, such as 1998, and then displays it, one digit per line, like so:
1
9
9
8
I don't have any idea on how to even get started on this, any help would be appreciated.
Have you studied loops and if so what kind of loops are you familiar with?
Have you called any methods on String objects before? If not, there is one you need to get familiar with: String#charAt(). You can read about it here: String (Java Platform SE 6)
Much luck!
I haven't studied anything that has to do with programming or java, and thanks for the link on string objects.
Hm, without your first studying some basics, I'm afraid that there's not much help we can offer you since you won't be able to understand our suggestions. I suggest you remedy this and here are some tutorials to get you started: The Really Big Index
In particular look up for loops: http://java.sun.com/docs/books/tutor...bolts/for.html
Good luck!
OK thanks for the help.