Question: Write a function to simulate the Lotto Quick Pick. Lotto is a lottery game where the players choose 6 numbers from 1 to 54, and

Write a function to simulate the Lotto Quick Pick. Lotto is a lottery game where the players choose 6 numbers from 1 to 54, and the Quick Pick option is to have the 6 numbers randomly chosen for you. The function should call the rand() function to produce 6 random numbers between 1 and 54. Make sure to randomize by seeding the rand function. In your main program, ask the user how many Quick Picks they want (between 1 and 10) and call your function that many times.

Include for the rand() and srand() functions and include for the time function.

EXTRA CREDIT: Prevent duplicate numbers from being selected (like in the example output below in Quick Pick 2 the number 22 comes up twice) up to 10 points.

Example output:

How many Quick Picks do you want (1 10)? 11

Please enter a number between 1 and 10: 0

Please enter a number between 1 and 10: 4

Quick Pick 1: 22 54 14 47 25 23

Quick Pick 2: 19 22 38 9 22 2

Quick Pick 3: 13 30 1 28 44 50

Quick Pick 4: 19 12 17 23 52 10

Press any key to continue . . .

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!