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

Thread: Write a program called Random50 that fills an array with fifty random values between 1 and 999. can anyone help me write this program??

  1. #1
    Junior Member
    Join Date
    Nov 2018
    Location
    Under Ya Mother Bed ;)
    Posts
    5
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Write a program called Random50 that fills an array with fifty random values between 1 and 999. can anyone help me write this program??

    Write a program called Random50 that fills an array with fifty random values between 1 and 999.
    However, before a number is entered into the array the program must check that the number is not
    already in the array. If it is already present then a new random number must be produced and
    similarly checked before entry. This process is repeated until a suitable number has been generated.
    To create random numbers you are not permitted to use pre-existing Array library methods to
    populate the array although you are allowed to use library methods from the Random class to
    generate random integers. The generation of random integers has not been covered in the lecture
    course but you should be capable of researching this problem and locating the appropriate tool for
    this exercise.
    Display the contents of the array in the following table format (i.e. ten lines of five numbers):
    123 045 436 785 876
    456 003

  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: Write a program called Random50 that fills an array with fifty random values between 1 and 999. can anyone help me write this program??

    What have you tried?
    Be sure to wrap any posted code in code tags.

    Do you have any specific questions about the assignment?

    Suggestion:
    Work through the list of requirements one at a time.
    Make a list of the required steps,
    Design and write and test the code for each step before moving to the next item in the list.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Nov 2018
    Location
    Under Ya Mother Bed ;)
    Posts
    5
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Write a program called Random50 that fills an array with fifty random values between 1 and 999. can anyone help me write this program??

    Not going to lie to you pal, im not the best at coding in java im more based in HTML and Javascript i need to complete this program for my university course

  4. #4
    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: Write a program called Random50 that fills an array with fifty random values between 1 and 999. can anyone help me write this program??

    Ok, we'll work on the coding one step at a time
    Make a list of the steps the program needs to take to solve the problem.
    Once you have the list of steps, I'll help you write the code for each step.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. When you write your first program what do you use to write in on?
    By BeginningProgrammer in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 19th, 2017, 07:54 PM
  2. Replies: 3
    Last Post: September 30th, 2014, 09:29 AM
  3. Replies: 1
    Last Post: March 23rd, 2014, 02:49 AM
  4. How do I write a passing array program that determines if the value...
    By JesusDaddy in forum What's Wrong With My Code?
    Replies: 4
    Last Post: December 16th, 2013, 10:23 AM
  5. How would I write this program?
    By mjballa in forum Java Theory & Questions
    Replies: 2
    Last Post: November 14th, 2011, 11:49 PM