Question: Write a program that will generate some 3-digit daily lottery numbers. More specifically, your program should: * Ask the user how many lottery numbers to
Write a program that will generate some 3-digit daily lottery numbers. More specifically, your program should:
* Ask the user how many lottery numbers to generate. Validate so that the input is between 1 and 366.
* Generate that many numbers in the range [0..999] and store them to an array. You should get different results each time you run your program.
* Send the numbers, one per line, to a data file named "lottery.txt". Display them so that 3 digits will be displayed for each number. The day number should be printed as shown below.
* For example, if you ran your program and said you wanted 7 lottery numbers, the file might end up looking something like this:
Day #1:492
Day #2:733
Day #3:043
Day #4:661
Day #5:829
Day #6:003
Day #7:481
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
