Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a new project in Visual Studio or other IDE. Write a program that simulates a lottery. The program should have array of 6 integers

Create a new project in Visual Studio or other IDE. Write a program that simulates a lottery. The program should have array of 6 integers named winning, with a randomly generated number in the range of 1 through 9 for each element in the array. The program should ask user to enter 6 numbers and store them in another integer array named player. The program then compares the numbers in 2 arrays to find out how many numbers match. If the two numbers are on the same position in both arrays, it is a match. (This is using parallel array concept to compare two arrays.) The program output should display the winning numbers, players numbers, and how many numbers matched. For instance, if your winning numbers are 3,5,9,1,4,7 and your players numbers are 2,5, 7,1, 9,8, then you have two matches (5 and 1). 5 is on the second position and 1 is on the fourth position in both arrays. Input Validation: Do not accept players number out of range of 1-9.

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago