Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago