Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: loop Help Please

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default loop Help Please

    Create a Java program class named LoopDemo with the following specifications:

    a. The class must have a method called forDemo that will demonstrate the use of a for loop to print all odd numbers between 1 and 20 (both inclusive)

    b. The class must have a method called whilePretestDemo that will demonstrate the use of a while loop of the pre-test type to print all odd numbers between 1 and 20 (both inclusive) - points

    c. The class must have a method called whilePostTestDemo that will demonstrate the use of a while loop of the post-test type to print all odd numbers between 1 and 20 (both inclusive) -points

    d. Exercise these methods from the main method by calling them -


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    20,985
    Thanks
    52
    Thanked 2,271 Times in 2,243 Posts

    Default Re: loop Help Please

    Do you have any questions about java programming?
    You've posted your assignment, now you need to come up with a design for the program and write some code.

  3. #3
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 168 Times in 159 Posts

    Default Re: loop Help Please

    No problems. I can do this for you in a few hours. You just put your feet up, relax, have a drink, play some x-box. Obviously your time is much more important than mine. Too important to do your own homework.
    Improving the world one idiot at a time!

  4. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default Re: loop Help Please

    No one will do your assignment for you.

    You need to make an effort and post some code. If you tell us where you are stuck, and attempt to make progress yourself, we will happily help.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

  5. #5
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 168 Times in 159 Posts

    Default Re: loop Help Please

    Quote Originally Posted by JavaPF View Post
    we will happily help.
    Speak for yourself. <mutter><grumble>
    Improving the world one idiot at a time!

Similar Threads

  1. [SOLVED] My while loop has run into an infinite loop...?
    By kari4848 in forum Loops & Control Statements
    Replies: 3
    Last Post: March 1st, 2011, 11:05 AM
  2. [SOLVED] Need help with while loop
    By anthony23415 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 6th, 2011, 02:23 PM
  3. for loop and while loop problems
    By Pulse_Irl in forum Loops & Control Statements
    Replies: 4
    Last Post: May 3rd, 2010, 02:09 AM
  4. hi. i want to rewrite this do loop into a while loop.
    By etidd in forum Loops & Control Statements
    Replies: 3
    Last Post: January 26th, 2010, 04:27 PM
  5. Need help with loop
    By SwEeTAcTioN in forum Loops & Control Statements
    Replies: 8
    Last Post: October 25th, 2009, 05:59 PM