Question: Write a program Lottery Printer that picks a combination in a lottery. In this lottery, players can choose 6 numbers (possibly repeated) between 1 and
Write a program Lottery Printer that picks a combination in a lottery. In this lottery, players can choose 6 numbers (possibly repeated) between 1 and 49. Construct an object of the Random class (see Exercise •• E2.13) and invoke an appropriate method to generate each number.
(In a real lot tery, repetitions aren’t allowed, but we haven’t yet discussed the programming con structs that would be required to deal with that problem.) Your program should print out a sentence such as “Play this combination—it’ll make you rich!”, followed by a lottery combination.

Data from Exercise 2.13
The Random class implements a random number generator, which produces sequences of numbers that appear to be random. To generate random integers, you construct an object of the Random class, and then apply the nextInt method. For example, the call generator.nextInt(6) gives you a random number between 0 and 5.
Write a program DieSimulator that uses the Random class to simulate the cast of a die, printing a random number between 1 and 6 every time that the program is run.
DE CALLBERRE 43565 15 36 36 46 6 16 g S ***** 20
Step by Step Solution
3.43 Rating (162 Votes )
There are 3 Steps involved in it
Heres how you could write a simple Java program to simulate a lottery drawing as described where six ... View full answer
Get step-by-step solutions from verified subject matter experts
