Answer:
import java.util.Random;
class Main {
public int stopAtFive (int j) {
Random rand = new Random();
int number = 0;
for(int i=0; i<j; i++) {
number = rand.nextInt(9)+1;
System.out.println(number);
if (number == 5) {
System.out.println();
break;
}
}
return number;
}
public static void main(String args[]) {
Main main = new Main();
main.stopAtFive(20);
main.stopAtFive(20);
}
}
Explanation:
Your requirements do not say what has to be displayed or returned from the method, but you can use this as a starting point.
Search Results
Featured snippet from the web
Fazlul Huq, the Prime Minister of Bengal, was a formal political statement adopted by the All-India Muslim League on the occasion of its three-day general session in Lahore on 22–24 March 1940.
I got it from google!
The reason the term "burn" is used is because the CD-writer, or burner, literally burns the data onto a writable CD. The laser in a CD-writer can be cranked up to a more powerful level than an ordinary CD-ROM laser. This enables it to engrave thousands of 1's and 0's onto a CD.
So that is why people talk about "burning" songs or files to CDs. They could just say they are "writing" the data to a CD, and it would make sense, but people seem to think "burning" sounds cooler.