At Westonci.ca, we provide clear, reliable answers to all your questions. Join our vibrant community and get the solutions you need. Get quick and reliable solutions to your questions from a community of seasoned experts on our user-friendly platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced 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;
}
}
Thanks for using our platform. We're always here to provide accurate and up-to-date answers to all your queries. We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. Get the answers you need at Westonci.ca. Stay informed with our latest expert advice.