Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You feel lucky today, and you decide to play the lottery. You walk into a gas station and decide to buy 4 tickets. Each ticket

image text in transcribed

You feel lucky today, and you decide to play the lottery. You walk into a gas station and decide to buy 4 tickets. Each ticket has 5 random numbers generated between 1 and 10 . Each ticket cannot include a repeating number. The code provided below returns 5 non-repeating random numbers between 1 and 10 (you need to import java.util.Random) Write a Java program that checks the 4 purchased tickets against the winning numbers. For that purpose, you need to do the following: 1. Create a method called "generateTicket" that includes the code provided ( 5 non-repeating random numbers) below and returns a single dimension array of type integer. 2. Create a single dimension array called "winningNumbers" for the winning numbers. 3. Create a two-dimensional array called "Tickets" to hold all 4 tickets" information. 4. Compare each ticket to the winning numbers and announce the winning as follows: a. \$100K if the ticket matches all 5 winning numbers. b. \$20K if the ticket matches 4 winning numbers. c. $2K if the ticket matches 3 winning numbers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

Students also viewed these Databases questions