# "Numbers Up and Down"

• 05-05-2011, 11:49 PM
thendnboi
"Numbers Up and Down"
<homework dump deleted>
• 05-06-2011, 12:22 AM
dlorde
So what would you like us to do?
• 05-06-2011, 12:24 AM
thendnboi
I would greatly appreciate if you could give me sample code that works AND explain how/why it works. Again, I am new to java.
• 05-06-2011, 12:30 AM
sunde887
What have you done so far? I suggest you break this program up into smaller pieces. First you should create two methods, one which tests if a number is an up number, and one which tests for down numbers.

After that it should be fairly easy to create 2 loops, test if the number fits the right criteria, if it does, print it.

We don't give you the code, we let you figure it out. If you post code use code tags
[code]
[/code]

• 05-06-2011, 12:34 AM
thendnboi
Ok, this is my first week in java, I need help! I don't have any ideas besides a while loop.
• 05-06-2011, 12:42 AM
thendnboi
Help?!?!?!?!?!?!?!
• 05-06-2011, 12:45 AM
sunde887
That is going to get you the exact opposite of help.

Try making a method to identify if a number is an up number.
• 05-06-2011, 12:49 AM
thendnboi
I am new to java!!! I don't know what that stuff is! Can you send me code and help me by explaining it!!!!
• 05-06-2011, 12:54 AM
sunde887
I'll give you some pseudo code
Code:

public boolean isUpNumber(int num){
create array
loop
split number with % and /, store in array
end loop
loop
make sure each number is greater than the previous
if not, return false
end loop
return true
}

• 05-06-2011, 12:54 AM
thendnboi
That doesnt help at all!
• 05-06-2011, 01:03 AM
sunde887
I'm here to help you, but not do it for you. You still have not really tried anything or asked any specific questions. What don't your understand about methods which determine whether the number is up or down?
• 05-06-2011, 01:04 AM
thendnboi
My specific question is can you please give me the full code? THANKS
• 05-06-2011, 01:05 AM
sunde887
• 05-06-2011, 01:07 AM
thendnboi
I HATE YOU! Help me! NOW
• 05-06-2011, 01:28 AM
sunde887
Code:

public class X{
public static void main(String[] args){
char[] answer = { 68, 111, 32, 121, 111, 117, 114,
32, 111, 119, 110, 32, 104, 111, 109, 101, 119,
111, 114, 107 };
for(int j = 0; j < answer.length; ++j){
}
System.out.println();
}
}

• 05-06-2011, 01:31 AM
thendnboi
I am serious help me....
• 05-06-2011, 01:33 AM
sunde887
I did, did you at least run that?
• 05-06-2011, 01:34 AM
thendnboi
Yes i ran it it said "Do your own homework"
• 05-06-2011, 01:42 AM
Fubarable
Thread locked. Original poster, you are welcome to go elsewhere if all you want to do is cheat.
• 05-06-2011, 01:44 AM
Fubarable
Oh, and you are banned as I've warned you before about not using this forum for cheating. Have a nice day.