Question: Write a c++ program that will generate some 3-digit daily lottery numbers. Your program should: * Ask the user how many lottery numbers they want

Write a c++ program that will generate some 3-digit daily lottery numbers. Your program should:

* Ask the user how many lottery numbers they want to generate. Check 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 "numbers.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 4 lottery numbers, the file might end up looking something like this:

Day #1: 666

Day #2: 332

Day #3: 193

Day #4: 021

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!