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

Thread: Need help for complicated java question

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Need help for complicated java question

    Write a program, using a for loop, to generate 10 random numbers between 15 and 150, inclusive. Then, the program should print how many of those numbers fall into the following categories: (1) between 15 and 50, inclusive; (2) between 51 and 100, inclusive, and (3) between 101 and 150, inclusive. Assume there is no user input for this program.


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,511
    My Mood
    Grumpy
    Thanks
    0
    Thanked 165 Times in 156 Posts

    Default Re: Need help for complicated java question

    Thanks for posting your homework question. The whole point of homework is for YOU to do it not us. We will not write the code for you. If you make an attempt at writing the code and get stuck, post your code here, include error messages and ask a specific question. "It doesn't work" is not specific. If you do not even know how to start then I suggest you talk to your teacher and get some intensive help.
    Improving the world one idiot at a time!

  3. The Following 2 Users Say Thank You to Junky For This Useful Post:

    derekxec (July 31st, 2013), suman.marri (July 29th, 2013)

  4. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Need help for complicated java question

    Hi, thanks for replying. I was stuck after this:
    (General java codes)
    import.java.util.Random;

    Random rand = new Random();
    int START = 15;
    int END = 150:

  5. #4
    Junior Member
    Join Date
    Jul 2013
    Posts
    3
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: Need help for complicated java question

    Last edited by jps; July 29th, 2013 at 05:54 PM. Reason: spoonfeeding

  6. The Following User Says Thank You to suman.marri For This Useful Post:

    phosphenes (July 29th, 2013)

  7. #5
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Need help for complicated java question

    @suman.marri please see the link in post #4

  8. #6
    Member llowe29's Avatar
    Join Date
    Jul 2013
    Posts
    116
    My Mood
    Tired
    Thanks
    9
    Thanked 5 Times in 5 Posts

    Default Re: Need help for complicated java question

    // here is the code for the main method
    **refer to the link in post #4**
    Last edited by jps; July 31st, 2013 at 04:49 PM. Reason: spoonfeeding

Similar Threads

  1. Complicated Multithreading
    By didingnuriska in forum Threads
    Replies: 16
    Last Post: April 19th, 2013, 02:17 PM
  2. Replies: 6
    Last Post: November 27th, 2012, 07:57 PM
  3. Challenging Java Question: Test your Java skill by grouping these terms
    By karthickk3 in forum Java Theory & Questions
    Replies: 3
    Last Post: July 18th, 2012, 10:10 PM
  4. Modifying a complicated object with dialog boxes
    By hunter555 in forum Java Theory & Questions
    Replies: 7
    Last Post: January 27th, 2011, 02:02 PM