help please

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2006
Posts: 2,449
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 261
Moderator
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Maven

Re: help please

 
0
  #11
Jul 21st, 2008
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.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 11
Reputation: zoooz_20 is an unknown quantity at this point 
Solved Threads: 0
zoooz_20 zoooz_20 is offline Offline
Newbie Poster

Re: help please

 
0
  #12
Jul 21st, 2008
thaaaaaaaanx my frind .... i'll do it and i will be back later ...


thaaaaaaaanx for ur advice ....


i'll be back
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 1,699
Reputation: javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all 
Solved Threads: 227
Featured Poster
javaAddict's Avatar
javaAddict javaAddict is offline Offline
Posting Virtuoso

Re: help please

 
0
  #13
Jul 21st, 2008
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.
Check out my New Bike at my Public Profile at the "About Me" tab
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 11
Reputation: zoooz_20 is an unknown quantity at this point 
Solved Threads: 0
zoooz_20 zoooz_20 is offline Offline
Newbie Poster

Re: help please

 
0
  #14
Jul 21st, 2008
hey again >>>


i have solve the second one>>
2. Write a program to compute the sum and product of all odd integers from 1 to 19.

<<<<<<<<<
the answer is :



  1. import java.util.Scanner;
  2.  
  3. public class program1 {
  4. public static void main(String [] args){
  5. Scanner scan =new Scanner(System.in);
  6.  
  7. int sum =0, product=1 ;
  8.  
  9.  
  10. for (int x = 1; x <= 19; x++) {
  11.  
  12. if (x % 2 ==1)
  13. sum=sum+x;
  14. }
  15.  
  16. for (int y = 1; y <= 19; y++) {
  17.  
  18. if (y % 2 ==1)
  19. product=product*y;
  20. }
  21.  
  22. System.out.println( sum+" "+ product );
  23.  
  24.  
  25. }
  26.  
  27. }



i dont know if its correct <<<

and the athers i dont understand the real idea >>

but i'll try ....
Last edited by Tekmaven; Jul 22nd, 2008 at 4:35 am. Reason: Code tags
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,240
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 490
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: help please

 
-1
  #15
Jul 21st, 2008
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]
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 29
Reputation: loken is an unknown quantity at this point 
Solved Threads: 0
loken's Avatar
loken loken is offline Offline
Light Poster

Re: help please

 
0
  #16
Jul 21st, 2008
It could help if you try to go over your program and write a pseudocode and then browse over java tutorials to interpret your pseudocode into java codes....

With a little effort you can answer these problems...

try the following links:
http://www.java2s.com/
http://www.roseindia.net/programming...Java-Tutorials
http://www.skillbuilders.com/Tutoria...0Tutorials.cfm
Last edited by loken; Jul 21st, 2008 at 10:24 pm. Reason: java references
Crash dump, something worse than dying...
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,449
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 261
Moderator
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Maven

Re: help please

 
1
  #17
Jul 22nd, 2008
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.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 973
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Solved Threads: 107
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Posting Shark

Re: help please

 
0
  #18
Jul 22nd, 2008
Originally Posted by masijade View Post
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.
Lol...

The site didn't seem organized to me just at first glance. I'll probably never go there again.

I've probably learned more here than I have alone. Dani for the win (yes I spelled it out) =P
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 92
Reputation: bloody_ninja is an unknown quantity at this point 
Solved Threads: 1
bloody_ninja bloody_ninja is offline Offline
Junior Poster in Training

Re: help please

 
0
  #19
Jul 22nd, 2008
/facepalm

I now I feel like an uber noob for going to RoseIndia
Last edited by bloody_ninja; Jul 22nd, 2008 at 3:42 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,240
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 490
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: help please

 
-1
  #20
Jul 22nd, 2008
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...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC