Generate random number for lottery( Mega Millions) using Java....

Published: 12 October 2019
on channel: Badri Khanal
362
9

In this video tutorial, we have developed code to generate random number for lotteries. We have taken a popular lottery Mega Millions as an example. And have developed java code in the format of Mega Millions. That is total 6 lucky numbers from 5 random numbers in the range 1 to 70 and 1 mega ball number in the range 1 to 25.
Correction: The maximum limit should be 71 to generate
random numbers from 0 to 70. So, the code should be :
For the first 5 numbers:
int first_5_Numbers = winningNumber.nextInt(71);
Similarly, for Mega Ball number :
The maximum limit should be 26 to generate
random numbers from 0 to 25. So, the code should be :
int sixth_Numbers = winningNumber.nextInt(26);


On this page of the site you can watch the video online Generate random number for lottery( Mega Millions) using Java.... with a duration of hours minute second in good quality, which was uploaded by the user Badri Khanal 12 October 2019, share the link with friends and acquaintances, this video has already been watched 362 times on youtube and it was liked by 9 viewers. Enjoy your viewing!