Write a function in Java that returns the winning numbers in next week's EuroMillions lottery draw....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Statistics For Business & Economics
ISBN: 9781285846323
12th Edition
Authors: David Anderson, Dennis Sweeney, Thomas Williams, Jeffrey Camm, James Cochran
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Light Sweet Petroleum, Inc., is trying to evaluate a generation project with the following cash flows: Year Cash Flow 0 %u2013$ 39,200,000 1 63,200,000 2 %u2013 12,200,000 a-1 What is the NPV for the...
-
Is Equal Employment Opportunity Sufficient? Why do we as a society still need Affirmative Action? Why isn't Equal Employment Opportunity sufficient to prevent workplace discrimination?
-
How do different substances ( lotion, water, hand sanitizer and hair gel ) affect the behavior of electrostatically charged objects? Explain.
-
An HR consultant gives an applicant a 75% chance of getting a job after registering with his agency. If the applicant gets a job, then there is a 60% possibility that he would be satisfied and would...
-
The following data come from the financial records of Bynum Corporation for 2011. Required How many times was interest earned in 2011? Sales Interest expense Income tax expense Net income $840,000...
-
Duggins Veterinary Supplies can issue perpetual preferred stock at a price of $50 a share with an annual dividend of $4.50 per share. Duggins must pay flotation costs of 5% of the issue price. What...
-
Create a concept map that depicts your assumptions and findings of the theory-practice gap. You are a staff nurse working in an intensive care unit and assigned to care for a 75-year-old African...
-
Auditors must make decisions regarding what evidence to gather and how much to accumulate. Which of the following is a decision that must be made by auditors related to evidence? A) Sample...
-
Assume your college or university is considering replacing its mainframe computer. Its current mainframe computer is now 15 years old and has been creating problems for some time. The cost of a...
-
A business engages in many types of activities. Required: For each of the following sets of changes in a business' accounts, give an example of an activity that the business could engage in that...
-
Prior to getting involved in networking, its a good idea to prepare an elevator speech. This is a 30-second pitch that summarizes what you want people to know about you. You might think of yourself...
-
You are in the process of interviewing for a sales position with Sun Life Financial in Toronto. In addition to filling out an application form and taking an aptitude test, one of the tasks the agency...
-
Your friend Georgia is planning to open an automobile parts shop and has come to you for advice about whether to use a perpetual or a periodic inventory system. Required: Before you advise her, list...
-
To make things more reasonable, lets look at a simpler example. Suppose Fred and Maria are going to divide a cake using the divider-chooser method. However, Fred is only entitled to 30% of the cake,...
-
What are some of the features of the Unified Process (UP)?
-
Consider the following data. What is the mean growth rate over these five periods? Period Rate of Return(%) 6.0 8.0 -4.0 2.0 5.4
-
A public utility is conducting a survey of mechanical engineers to learn more about the factors influencing the choice of heating, ventilation, and air conditioning (HVAC) equipment for new...
-
The Tire Rack maintains an independent consumer survey to help drivers help each other by sharing their long-term tire experiences. The data contained in the file named TireRatings show survey...
-
Following is a list of information for Peter and Amy Jones for the current tax year. Peter and Amy are married and have three children, Aubrynne, Bryson, and Caden. They live at 100 Main Street,...
-
Kelly and Chanelle Chambers, ages 47 and 45, are married and live at 584 Thoreau Drive, Boston, MA 59483. Kellys Social Security number is 111-11-1111 and Chanelles is 222-22-2222. The Chambers have...
-
The amplitude of a surface wave for which \(\lambda=0.050 \mathrm{~m}\) is \(5.0 \mathrm{~mm}\) at a distance of \(1.0 \mathrm{~m}\) from a point source. What is the amplitude of the wave (a) 10 m...
Study smarter with the SolutionInn App