Generates seven distinct random numbers between 1 and 20


Problem

You are assigned to program a game that simulates a monthly lottery. Every month, seven distinct random integers between 1 to 20 (inclusive) are drawn. Using a vector, do the followings:

a. Generates seven distinct random numbers between 1 and 20 (inclusive) and stores them in a vector.

b. Sorts the vector containing the lottery numbers.

c. Prompts the player to select seven distinct integers between 1 and 20 and stores the numbers in the vector.

d. Determines whether the player guessed the lottery numbers correctly. If the player guessed the lottery numbers correctly, it outputs the right message. Your program should allow a player to play the game as many times as the player wants to play.

• You have to use vectors not arrays. • Add comments to explain your solution.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Generates seven distinct random numbers between 1 and 20
Reference No:- TGS02642595

Now Priced at $25 (50% Discount)

Recommended (93%)

Rated (4.5/5)