Write a program LotteryPrinter that picks a combination in a lottery. In this lottery, players, can choose 6 numbers (possibly repeated) between 1 and 49. Your program should print out a sentence such as "Play this combination—it'll make you rich!", followed by a lottery combination.
1
Expert's answer
2013-07-22T11:51:20-0400
import java.util.Random;
public class LotteryPrinter { public static void main(String[] args) { System.out.println("Play this combination - it'll make you rich!"); Random rnd = new Random(); for (int i = 0; i < 6; i++) { System.out.print(rnd.nextInt(49) + 1); System.out.print(" "); } System.out.println(); } }
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Awesome. Thank you