Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago