The program randomly generates a lottery of a three-digit


Question: You need to make a program to play lottery.

The program randomly generates a Lottery of a three-digit number ( any number from 100 to 999), prompts the user to enter a three-digit number, and determines whether the user wins according to the subsequent rule:

a. If the user matches the lottery in exact order , the awards is $100,000.

b. If the user input matches the lottery digits, the awards is $50,000.

c. If two digit in the user input matches a digit in the lottery, the awards is $30,000.

d. If one digit in the user input matches a digit in the lottery, the awards is $10,000.

Sample solution:

The winning number is 865.

Your ticket is 865 then 100000

Your ticket is 686, or 568,.. all digits are right but not in order

You get 50000

Your ticket is 860, or 186 .. then 30000

Your ticket is 800, 706, 600.. just one digit much you get

10000

Else

0

Please execute the program to check errors. It must compile with no errors and follow the directions.  Thank you.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: The program randomly generates a lottery of a three-digit
Reference No:- TGS0951400

Expected delivery within 24 Hours