Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program which simulates a lottery, allowing any number of players to participate in the lottery game. The program should declare, in main, an

Write a program which simulates a lottery, allowing any number of players to participate in the lottery game. The program should declare, in main, an array of five integers named lottery and a vector of integers named user. Then have the user enter 5 different digits in an overloaded function to fill the lottery array. Any number of players can now play the lottery. In main have the user enter a lottery player's full name, and have the user enter 5 different integers in a second version of the overloaded function to fill the vector. Validate that all digits for the array and vector are neither negative nor greater than 9. In main have your program match the numbers in the array to those in the vector to determine which numbers in the user vector match any of the numbers in the lottery array (i.e., not just the numbers in "corresponding" positions). Display in main the player's name, the user vector, the number of matching digits, and the digits which match, and display a congratulatory "Grand Prize" message, with the user's name, if all digits match. Then have another player try the lottery, or quit the game. You may not sort the array nor the vector, and must use loops to process both. -the lottery array consists of: 7, 4, 9, 1, 3 Provide two screen prints: -name: Iam A. Gambler, with user vector: 0, 2, 9, 6, 3 -name: Help Imhooked, with user vector: 1, 9, 7, 3, 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

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

Intelligent Image Databases Towards Advanced Image Retrieval

Authors: Yihong Gong

1st Edition

1461375037, 978-1461375036

More Books

Students also viewed these Databases questions

Question

What are the major political issues in this case?

Answered: 1 week ago

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago