Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please Write a program that creates (and stores) a 2-D array of 64 random integers (8 nows and 8 columns) between l and 10The

image text in transcribed
image text in transcribed
C++ please
Write a program that creates (and stores) a 2-D array of 64 random integers (8 nows and 8 columns) between l and 10The program should then print out theelements of the array, as well as the element location (row and column) of the largest valueis) in the array Next rotate the array so that the rows become the columns and the columns become rows and store the rotated values in a second 2-D array. Print the rotated array, along with the location of the maximum valuels) Specifications: Use constants to define the number of rows and columns in your ay (RoWS and COLSI Use the srandO function to seed the random number generator after reading in a seed value. The rando function should be called multiple times to generate the integers-fill in the elements of the array row by row. Print the results with a width of S. Use the following function prototypes to help you program your solution void seedRNG (unsigned int seed) // Seeds the Random Number Generator with the "seed" value int randNum (vold) // Returns a random number between 1-100 void populateArray (int a [RONS] ICOLS1) // Populates an array with zandom values betveen 1-100 int findMax (int a [ROWS] [COLSD // Returns the maximum value of the array void printArray (int a IROWS] [COLSD // Prints the 2-D array void printMax (int a[ROWS1ICOLS).int max) // Prints the row, column location(s) of the maximum value(s) void rotateArray (int a[ROWS] ICOLS]. int b[ROWS1 [COLS]) // Rotates array all into bl1 / ROW positions in allli become column positions in bl COLUMN positions in all11 become row positions in b If you execute the program, the following information should be displayed main.o Enter a random seed: 34 59 69 567 39 90 68 75 56 99 55 45 10 59 56 79 62 45 28 1016 91 24 21 64 42 39 97 100 7 23 19 45 64 257 31 51 33 29 77 9063 85 20 76 81 100 85 892 64 87 5 25 38 57 8 Maximum Value at Element:3. Maxinum Value at Element:6,3 59 68 6 915 2064 69 75 7924 23 3376 87 5 56 62 21 19 2942

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago

Question

What did they do? What did they say?

Answered: 1 week ago