Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE CODE IN C++ USE 2D ARRAYS (I have learned up to that I am still a beginer please help me ) Your state is

PLEASE CODE IN C++ USE 2D ARRAYS (I have learned up to that I am still a beginer please help me )

image text in transcribed

Your state is in a process of creating a weekly lottery. Once a week, five distinct random integers between 1 to 40 (inclusive) are drawn. If a player guesses all of the numbers correctly, the player wins a certain amount. Write a program that does the following a) Generates five distinct random numbers between 1 and 40 (inclusive) and stores them in an array b) Sorts the array containing the lottery numbers. c) Prompts the player to select five distinct integers between 1 and 40 (inclusive) and stores the numbers in an array. The player can select the numbers in any order, and the array containing the numbers need not be sorted d) Determines whether the player guessed the lottery numbers correctly. If the player guessed the lottery numbers correctly, it outputs the message "You win!" otherwise it outputs the message "You lose!" and outputs the lottery numbers. Your program should allow a player to play the game as many times as the player wants to play. Before each play, generate a new set of lottery numbers Enter five distinct integers between 1 and 40 (inclusive): Enter the first number: 22 Enter the next number: 23 Enter the next number:60 Number must be between 1 and 40. Select another. Enter the next number: 11 Enter the next number: 40 Enter the next number: 1 Enter the next number: You lose! The correct numbers are 20 23 26 29 33 Play another (Y/y)/(N): n Press any key to continue

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

More Books

Students also viewed these Databases questions

Question

How can credibility of qualitative research studies be ensured?

Answered: 1 week ago

Question

4 How can you create a better online image for yourself?

Answered: 1 week ago