Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that randomly generates a lottery of a two-digit number, prompts the user to enter a two-digit number, and determines whether the user

Write a program that randomly generates a lottery of a two-digit number, prompts the user to enter a two-digit number, and determines whether the user wins according to the following rule

If the user input matches the lottery in exact order, the award is $10,000. If the user input matches the lottery, the award is $3,000. If one digit in the user input matches a digit in the lottery, the award is $1,000. Else no award

Two sample inputs and outputs shown here:

Enter your lottery pick (two digits): 54 The lottery number is 88 Sorry, no match 
Enter your lottery pick (two digits): 38 The lottery number is 30 Match one digit: you win $1,000 

Topics covered: Random Generator, Decision structures, Relational and logical operators.

In C code ( not c** or java)

Thank you!

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 J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

=+ Have they changed the way employers view IP?

Answered: 1 week ago