peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
for loop from 1 to 19
if statement is num%2 == 1
yes, add to sum
no, next number
problem solved
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Come on now, show some effort. Show us what you have tried in solving those problems, and provide information about what is going wrong with them and we will help you correct them, but we will not do them for you.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
No one's forgotten you, but it seems as though you have been wasting your time, and us wasting our time to make up for that isn't going to happen.
Show what you have for the other problems and we will help you to correct it, as already said, but we are not going to do it for you.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
For 2, what are all even numbers divisible by that odd numbers are not?
For 4, loop backwards.
For 5, nested loops.
For 6, a loop and a an array of length 5 for summing, and divide by 10 and minus 5 to index into it.
There, there are the ideas for each of them.
Us doing your homework for you would not help you. You would learn nothing, and so would come back here tommorrow begging for "help" again, because what you need to do tommorrow built on what you did today, but you didn't do anything today (other than cut-n-paste). That's the way it is, if we simply do it for you, so, no, we are not going to do it for you, that does not help you. Those who fail with effort still understand more than those who pass without it.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
If you have solved a problem and you run it and it works then don't post it. Post only those that you are having problems with.
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
Does it compile?
Are there any errors?
Is it doing what you expect to do?
And please start using code tags (without spaces inside square brackets)
[ code=java]
private final String = "For easy readability, always wrap programming code within posts in [ code] (code blocks) and [icode] (inline code) tags.";
[/code]
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
With the exception of that second link which has mainly obsolete, and often times simply bad, tutorials/examples/advice. Roseindia is a blight on the Java world. Nearly everytime I see someone use some really bad practice on many forums and tell them not to do that, they often come back and say "But the tutorial I followed showed it this way!". And where did they get that tutorial ---> Roseindia. Nuff said.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
/facepalm
I now I feel like an uber noob for going to RoseIndia
bloody_ninja
Junior Poster in Training
96 posts since Jul 2008
Reputation Points: 9
Solved Threads: 2
Also first link to java2s.com is loose-win situation.
I would not recommend that site to beginner because either they will learn nothing from it as it does not contain any explanation to the code (code there is simple free copy to code from numerous books, some already out of date) or they will just copy&paste without understanding what that thing does.
However I use that site time-to-time, but I think I'm past the learning of for or while loops...
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902