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 2 of 2

Thread: Can someone help me with my simple HW assignment, i am a complete beginner :(

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can someone help me with my simple HW assignment, i am a complete beginner :(

    this is the assignment:

    A while loop. Before you enter the while loop, use a random number generator to generate an integer between 1 and 100. Your while loop terminating condition will be if that number is greater than 30. Inside the loop print the number and add one to it.
    Example: If my random number generator gives 25, my program will print 25, 26, 27, 28, 29, 30.
    If my random number generator gives 40, my program will exit and nothing will be printed.
    A do-while loop. Same logic as in the while loop, but in this case we want to print the number that the random number generator picked, even if it is above 30.
    In this case if 40 is chosen at random, 40 should print and the program should terminate.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Can someone help me with my simple HW assignment, i am a complete beginner :(

    What have you tried? Do you have any specific java programming questions?

    Be sure to wrap any posted code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Complete Beginner of C++ Graphics Programming(Help in simple checker game)
    By klamgade in forum Other Programming Languages
    Replies: 1
    Last Post: October 8th, 2014, 03:02 AM
  2. Complete Beginner of C++ Graphics Programming(Help in simple checker game)
    By klamgade in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 7th, 2014, 09:30 PM
  3. my assignment..not able to complete it...please help...
    By d4divya2005 in forum What's Wrong With My Code?
    Replies: 13
    Last Post: December 7th, 2012, 11:39 AM
  4. Need help to complete my assignment.
    By wildwhitecat in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 8th, 2012, 05:19 PM
  5. Beginner needs help with simple java assignment.
    By joachim89 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 6th, 2010, 07:53 PM