Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

java
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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions