User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 402,048 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,522 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 797 | Replies: 30
Reply
Join Date: Feb 2006
Posts: 1,375
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 120
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: help please

  #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  
Join Date: Jul 2008
Posts: 11
Reputation: zoooz_20 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zoooz_20 zoooz_20 is offline Offline
Newbie Poster

Re: help please

  #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  
Join Date: Dec 2007
Location: Greece
Posts: 476
Reputation: javaAddict is on a distinguished road 
Rep Power: 1
Solved Threads: 49
javaAddict's Avatar
javaAddict javaAddict is offline Offline
Posting Pro in Training

Re: help please

  #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.
I AM the 12th CYLON
Reply With Quote  
Join Date: Jul 2008
Posts: 11
Reputation: zoooz_20 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zoooz_20 zoooz_20 is offline Offline
Newbie Poster

Re: help please

  #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 :



import java.util.Scanner;
  
  public class program1 {                                                       
    public static void main(String [] args){                                   
     Scanner scan =new Scanner(System.in);
    
        int  sum =0, product=1 ;                                                            
    
    
       for (int x = 1; x <= 19; x++) {
  
             if (x % 2 ==1)
             sum=sum+x;
      }
        
        for (int y = 1; y <= 19; y++) {
  
             if (y % 2 ==1)
             product=product*y;
      }
        
  System.out.println( sum+"       "+ product );  
         
 
    }  
 
}




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 3:35 am. Reason: Code tags
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,222
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 10
Solved Threads: 270
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: help please

  #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)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Jul 2008
Posts: 26
Reputation: loken is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
loken's Avatar
loken loken is offline Offline
Light Poster

Re: help please

  #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 9:24 pm. Reason: java references
Crash dump, something worse than dying...
Reply With Quote  
Join Date: Feb 2006
Posts: 1,375
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 120
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: help please

  #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  
Join Date: Jun 2008
Location: WA, USA
Posts: 672
Reputation: Alex Edwards has a spectacular aura about Alex Edwards has a spectacular aura about Alex Edwards has a spectacular aura about 
Rep Power: 4
Solved Threads: 56
Alex Edwards's Avatar
Alex Edwards Alex Edwards is online now Online
Practically a Master Poster

Re: help please

  #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  
Join Date: Jul 2008
Posts: 92
Reputation: bloody_ninja is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
bloody_ninja bloody_ninja is offline Offline
Junior Poster in Training

Re: help please

  #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 2:42 am.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,222
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 10
Solved Threads: 270
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: help please

  #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)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Java Forum

All times are GMT -4. The time now is 11:39 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC