Question: Write a program in java LotteryPrinter that picks a combination in a lottery. In this lottery, a lottery ticket consists of 6 numbers (with none
Write a program in java LotteryPrinter that picks a combination in a lottery. In this lottery, a lottery ticket consists of 6 numbers (with none repeating) between 1 and 49. Construct an object of the Random class and invoke an appropriate method to generate each number. The numbers should be stored in an array and you must include some kind of logic to ensure that no two numbers are the same. Your program should print out a sentence such as Play this combinationitll make you rich! followed by a lottery combination.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
