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.


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

Results 1 to 3 of 3

Thread: i need guidance por favor<333

  1. #1
    Junior Member
    Join Date
    Oct 2012
    My Mood
    Thanked 0 Times in 0 Posts

    Unhappy i need guidance por favor<333

    neeeeeew to java and i was given this assignment:

    "Write an app that loads 20 random integers into an array. The random values should be
    positive values less than 50. Write the numbers out to the screen. Then write the numbers to
    the screen in reverse order.

    Example output:

    The numbers in order are:

    21 3 7 17 43 31 19 21 40 2 37 28 15 5 48 35 11 2 0 33

    The numbers in reverse order are:

    33 0 2 11 35 48 5 15 28 37 2 40 21 19 31 43 17 7 3 21"

    help meeee

    this is all i have so far:

    int[] a;
    a = new int[20];
    int b;
    for(b=0; b<20; b++)
    a[b] = (int)(Math.random()*50.0);
    System.out.println("The numbers in order are:");
    System.out.print(a[0] + " ");

  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: i need guidance por favor<333

    Please read
    Forum rules
    This forum is for saying Hi

    I have moved your post out of the Members Introductions.

    I would also recommend reading

  3. #3
    Join Date
    Mar 2011
    My Mood
    Thanked 4 Times in 4 Posts

    Default Re: i need guidance por favor<333

    Well, what exactly do you have a problem with? The code you provide so far fills an array with random integers. Now what else do you have to do? You need to print each integer from the array and in reverse order. Now how do you think you can accomplish this? Think about how you can do it with pen and paper first. You have an array, now what can you do to it to make it display what's inside? The second part of the code prints out the integer in the index 0, I can see you have the right idea, now you just have to go one step further.

Similar Threads

  1. Hi Every One Sahaja Here!! Need Guidance
    By sahaja in forum Member Introductions
    Replies: 6
    Last Post: July 3rd, 2012, 09:52 AM
  2. Recursion Guidance
    By Mission_Control in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 2nd, 2011, 09:35 PM
  3. Some guidance with a program please
    By derekxec in forum Java Theory & Questions
    Replies: 3
    Last Post: June 11th, 2011, 05:52 AM
  4. Looking for guidance and instructions
    By coyboss in forum Java Theory & Questions
    Replies: 4
    Last Post: February 12th, 2011, 10:57 AM
  5. [SOLVED] Medication of ArrayDemo.java to include iterative menu
    By xyldon27 in forum Loops & Control Statements
    Replies: 8
    Last Post: June 30th, 2009, 02:10 AM

Tags for this Thread