So the question for my assignment is "Produce a horizontal star line that show your 10 variables from top to bottom as individual, distinct stars varying based on its value. For example, random number is 4, so I will have ****
.
This is what I did so far
import java.util.*;
public class Problem01 {
public static void main(String[] args){
//create random integer
Random ran = new Random();
for (int i = 1; i <=10; i++ ){
int random = ran.nextInt(20);
//Printing the random number
System.out.println("Number " + "(" + random + "): ");
}
}
}
I can generate 10 random number but I don't know how generate the stars, can you guys help me, thanks a lot.