K
KyoGaSuki
I just started taking a Programming With JAVA class and we have a lab
to do, and I just can't figure it out.
First, I am supposed to ask the user for a 4-digit number (I think
this is correct):
System.out.print("Please Enter A 4-Digit Integer: ");
Then we are supposed to output the digits onto separate lines:
ex: 4321 would look like
4
3
2
1
I know that to do this I can divide it first by 1000, then divide the
remainder by 100, then that remainder by 10...But my problem is
defining the variable (or the number that the user inputs). Can
anybody help? This isn't a graded assignment, but I just want to
understand what I am doing wrong. Please help.
to do, and I just can't figure it out.
First, I am supposed to ask the user for a 4-digit number (I think
this is correct):
System.out.print("Please Enter A 4-Digit Integer: ");
Then we are supposed to output the digits onto separate lines:
ex: 4321 would look like
4
3
2
1
I know that to do this I can divide it first by 1000, then divide the
remainder by 100, then that remainder by 10...But my problem is
defining the variable (or the number that the user inputs). Can
anybody help? This isn't a graded assignment, but I just want to
understand what I am doing wrong. Please help.