Question: Write a function in Java that returns the winning numbers in next week's EuroMillions lottery draw. The function should have the form: int[] lotteryNumbers()
Write a function in Java that returns the winning numbers in next week's EuroMillions lottery draw. The function should have the form: int[] lotteryNumbers() where the function uses the Math class random() method to return an array of 7 integers, the first 5 between 1 and 50 and the last two between 1 and 11. Note that the same number cannot be included twice. Q7. Write a Java class called Statistics that has two members, an array of doubles and a length that will store the length of the array. Add a constructor and a display method that displays the contents of the array. You should be able to construct an object of your Statistics class by using: double [] anArray = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); Statistics s = new Statistics (anArray); Q8. Modify your class in Q7 to add an average(), max() and min() methods, which each return the average of the array, the maximum and the minimum value in the array respectively.
Step by Step Solution
There are 3 Steps involved in it
Write a function in Java that returns the winning numbers in next weeks EuroMillions lot... View full answer
Get step-by-step solutions from verified subject matter experts
