I'm an idiot, need simple help
Well I did aweosme in my first java course, but this second one is making me look like an idiot. My first assignment is to edit the following program so that it outputs 10 numbers per line. We can only edit the display part of the program. My usual firend I ask for help is MIA right now, so I was wondering if anyone could push me int he right direction.
I know I need to add a loop where it adds numbers to arrays if there is a number to add, I just forget how to do it.
import java.io.*;
import java.util.*;
class APISortMain {
public static void display(int[] a, int size){
for(int i=0; i<size; i++){
System.out.print(a+"\t");
}
System.out.println();
System.out.println();
}
public static void main(String args[]) throws IOException {
Random r = new Random();
//Arrays A = new Arrays();
int[] able = new int[500];
int amount = 50+r.nextInt(30);
for(int i=0; i><amount; i++){
able = 1000+r.nextInt(5000);
}
System.out.println("Data unordered");
display(able, amount);
System.out.println("Data ordered");
Arrays.sort(able, 0, amount);
display(able, amount);
amount = 50+r.nextInt(30);
for(int i=0; i><amount; i++){
able = 1000+r.nextInt(5000);
}
System.out.println("Data unordered");
display(able, amount);
System.out.println("Data ordered");
Arrays.sort(able, 0, amount);
display(able, amount);
}
}
I'm no asking you to do it for me, just give me a little help, please!>

