Question: This question is in Java this is the best image I can provide Question 2 and 3 in Assignment 1.pdf - Adobe Reader - o

 This question is in Java this is the best image I

This question is in Java this is the best image I can provide

Question 2 and 3 in Assignment 1.pdf - Adobe Reader - o X File Edit View Window Help Open 22 12 + 114% - BED Tools Fill & Sign Comment Sign In Export PDF Adobe ExportPDF Convert PDF files to Word or Excel online. rogramming Challenges Select PDF File: 2 Question 2 and 3 in Assignm... 1 file / 2.12 MB Convert To: Microsoft Word (*.docx) ( 10/Lottery Application Write a Lottery class that simulates a lottery. The class should have an array of five intgers named lotteryNumbers. The constructor should use the Random class (from the Java API) to generate a random number in the range of 0 through 9 for each element in the array. The class should also have a method that accepts an array of five integers that represent a per- son's lottery picks. The method is to compare the corresponding elements in the two arrays and return the number of digits that match. For example, the following shows the lotteryNumbers array and the user's array with sample numbers 'stored in each. There are two matching digits (elements 2 and 4). lotteryNumbers array: Recognize Text in English(U.S.) Change Convert ORAN Create PDF Edit PDF Send Files User's array: Store Files In addition, the class should have a method that returns a copy of the lotteryNumbers array. Demonstrate the class in a program that asks the user to enter five numbers. The program should display the number of digits that match the randomly generated lottery numbers. If all of the digits match, display a message proclaiming the user a grand prize winner, PAS . i 15:48

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!