Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use c++ coding Create a project and program named YourLastNameLottery. Write a program that simulates a lottery. The program should have an array of five

image text in transcribedUse c++ coding
Create a project and program named YourLastNameLottery. Write a program that simulates a lottery. The program should have an array of five integers named lottery, and should generate a random number in the range of 0 to 9 for each element in the array. The user should enter 5 digits which should be stored in an integer array named user. The program should validate that the digits from the user are between 0 and 9. The program is to compare the corresponding elements in the two arrays and keep a count of the digits that match. For example, the following shows the lottery array and the user array with sample numbers stored in each. There are two matching digits (elements 2 and 4) lottery array: 4 9 user array: 4 2 The program should display the random numbers stored in the lottery array and the number of matching digits. If all of the digits match, display a message proclaiming the user as a grand prize winner. Extra Credit Portion: Create an integer vector called matching and put into it any of the user's digits that appear in the lottery array. Finally, display the contents of the matching vector. In the above example, the matching vector would be: 4

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_2

Step: 3

blur-text-image_3

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

What teacher supports and services are needed? (D2, D7, D8)

Answered: 1 week ago

Question

What lessons in OD contracting does this case represent?

Answered: 1 week ago

Question

Does the code suggest how long data is kept and who has access?

Answered: 1 week ago