Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

Write a function in Java that returns the winning numbers in next weeks EuroMillions lot... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistics For Business & Economics

Authors: David Anderson, Dennis Sweeney, Thomas Williams, Jeffrey Camm, James Cochran

12th Edition

978-1305264335, 1305264339, 128584632X, 978-1285846323

More Books

Students also viewed these Programming questions