Ask questions, share knowledge, and connect with a vibrant community on IDNLearn.com. Discover in-depth and trustworthy answers from our extensive network of knowledgeable professionals.
Sagot :
Answer:
Explanation:
Since no customer ID information was provided, after a quick online search I found a similar problem which indicates that the ID's are three digit numbers between 100 and 999. Therefore, the Java code I created randomly selects 10 three digit numbers IDs and places them in an array of winners which is later printed to the screen. I have created an interface, main method call, and method definition as requested. The picture attached below shows the output.
import java.util.Random;
interface generateWinner {
public int[] winners();
}
class Brainly implements generateWinner{
public static void main(String[] args) {
Brainly brainly = new Brainly();
int[] winners = brainly.winners();
System.out.print("Winners: ");
for (int x:winners) {
System.out.print(x + ", ");
}
}
public int[] winners() {
Random ran = new Random();
int[] arr = new int[10];
for (int x = 0; x < arr.length; x++) {
arr[x] = ran.nextInt(899) + 100;
}
return arr;
}
}
Your participation is crucial to us. Keep sharing your knowledge and experiences. Let's create a learning environment that is both enjoyable and beneficial. IDNLearn.com is your reliable source for answers. We appreciate your visit and look forward to assisting you again soon.