Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

BACKGROUND Write a C++ program to house a 4x4 grid of randomly generated single digit number pairs ranging from 1 to 8 for example: 3186

image text in transcribed

BACKGROUND Write a C++ program to house a 4x4 grid of randomly generated single digit number pairs ranging from 1 to 8 for example: 3186 2475 8624 3715 - use a single 2-dimensional array to store the digits in a 4x4 grid: the user will refer to locations on your grid as 1.1 for the top left corner, down to 4,4 for the bottom right corner in the example above. user location 1.1 holds a value of 3 and user location 4 4 holds a value of 5 FILL THE GRID -generate 8 single digit random numbers having a value between 1 and 8 (if a particular digit has already been randomly generated, then keep requesting a random digit from 1 to 8 until you retrieve a random digit that has not already been generated) - as you identify a new random digit value to use, place that single digit in two different, not yet used, random locations of the 4x4 grid in the example above, suppose I generated a 3 for my first random digit. then I stored that 3 at random location 1.1 and random location 4.1 - continue generating random digits from 1 to 8 until you havs used all of the digits, and fill the 4x4 grid with 8 pairs of each digit from 1 through B as described above - keep a log of the generated random digits and the order they were generated, including logging duplicates keep a log of each attempt to place a digit at a coordinate location, including coordinate duplicate attempts the above will fill in the grid... DISPLAY THE RESULTS - after the grid has been filled in, display the 4x4 grid of single digit numbers: Grid (example): 3186 2475 86 24 37 15 after the grid has been filled in, display the log of your generated random digits, in this format Randomly generated digit sequence (example): 5/7/2/1/2/2/3/6/5/4/3/2/8/.. after the grid has been filled in, display the log of your coordinate placement attempts, in this format Grid location placement attempt sequence (example): 3,3 / 1,1/2,4/3,3/12/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions