Jonathan F. answered 12/22/15
Tutor
4.9
(400)
Expert Programmer Specializing in C++ and Java
To get a random integer between MIN and MAX, inclusive, use the following Java code:
int n = MIN + (int)Math.floor(Math.random() * (MAX - MIN + 1));
Now, you want to print the @ that many (n) times. Just use a simple for loop:
for (int i = 0; i < n; ++i)
System.out.print('@'); // indent this, WyzAnt destroys indenting!
After the for loop, use System.out.println(); to put the cursor on the next line.