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: Help pls ...

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help pls ...

    To simulate it, the program will generate a random number between 0 and 19, which represents the location in the array (i.e. index number). Then, the 3 numbers to the left and right of this location should be reset to the value 0. If there isnít 3 numbers to the left and right you may assume a lesser number depending on the boundaries of the array.

    How to reset the numbers to 0 in the final array ?


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,329
    My Mood
    Mellow
    Thanks
    253
    Thanked 781 Times in 766 Posts

    Default Re: Help pls ...

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    To set the value of an array element:

    myArray[index] = value;

    where 'value' is the desired value of the element and of the correct type. If you do not understand arrays, I recommend you work through the Oracle tutorial on arrays.

Similar Threads

  1. help me pls
    By ayki in forum Java Theory & Questions
    Replies: 3
    Last Post: September 2nd, 2013, 09:50 PM
  2. Pls help
    By avi11 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 21st, 2013, 05:43 AM
  3. Help Pls..
    By shen_punkz21 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 28th, 2013, 12:41 PM
  4. HI PLS HELP
    By Virat Pandey in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 23rd, 2012, 06:12 AM
  5. pls.pls.pls.help with this
    By izzahmed in forum What's Wrong With My Code?
    Replies: 8
    Last Post: October 25th, 2011, 12:30 PM