1- fillArray_1D() method, to initialize the 1D array with random values (between 0 and 99) void fillArray_1D(int array[], int size) { for(int i = 0; i < size; i++) { array[i] =(rand() % 100); } } • fillArray_2D() method, to initialize the 2-D array with random values (between 0 and 99). For the sake of simplicity, assume the 2D array size is always [3][3]. void fillArray_1D(int array[3][4]) { for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; i++) { } } } array[i][j] = (rand() % 100); 2- printArray_1D () method, to display 1D array. • printArray_2D () method to display 2D array. • belowAboveAvg () method which first finds the average of all random numbers entered in 1D array and then finds and displays the number of elements less than and greater than the average. swapLargestSmallest() method which swaps largest and smallest elements in the 1D array. sumRowsColumns () method which finds and displays sum of each row and each column of the 2D array. • repeatedElementsRow () method which displays row(s) which contain(s) repeated elements in 2D array. 3- 3. In the main () method, ▪ Ask the user to enter the number of elements in 1D array. ▪ Create test1D Array: int test1D[noOflements] ; ▪ Fill the elements in the test1D array, by calling fillArray_1D(test) method. ▪ Task1: Finds the average of all random numbers entered in 1D array and then finds and displays the number of elements less than and greater than the average, by calling belowAboveAvg () method. ▪ Task2: Swaps largest and smallest elements in the 1D array, swapLargestSmallest () method. ▪ Create test2D Array, and assume in all related functions the following size: int test2D [3][4]; ▪ Fill the elements in the test2D array, by calling fillArray_2D(test2D) method. ▪ Task3: Finds and displays sum of each row and each column of the 2D array., by calling SumRowsColumns() method. ▪ Task4: Displays row(s) which contain(s) repeated elements in 2D array, by calling repeatedElementsRow() method.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
1- fillArray_1D() method, to initialize the 1D array with random values (between 0 and 99) void fillArray_1D(int array[], int size) { for(int i = 0; i < size; i++) { array[i] =(rand() % 100); } } • fillArray_2D() method, to initialize the 2-D array with random values (between 0 and 99). For the sake of simplicity, assume the 2D array size is always [3][3]. void fillArray_1D(int array[3][4]) { for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; i++) { } } } array[i][j] = (rand() % 100); 2- printArray_1D () method, to display 1D array. • printArray_2D () method to display 2D array. • belowAboveAvg () method which first finds the average of all random numbers entered in 1D array and then finds and displays the number of elements less than and greater than the average. swapLargestSmallest() method which swaps largest and smallest elements in the 1D array. sumRowsColumns () method which finds and displays sum of each row and each column of the 2D array. • repeatedElementsRow () method which displays row(s) which contain(s) repeated elements in 2D array. 3- 3. In the main () method, ▪ Ask the user to enter the number of elements in 1D array. ▪ Create test1D Array: int test1D[noOflements] ; ▪ Fill the elements in the test1D array, by calling fillArray_1D(test) method. ▪ Task1: Finds the average of all random numbers entered in 1D array and then finds and displays the number of elements less than and greater than the average, by calling belowAboveAvg () method. ▪ Task2: Swaps largest and smallest elements in the 1D array, swapLargestSmallest () method. ▪ Create test2D Array, and assume in all related functions the following size: int test2D [3][4]; ▪ Fill the elements in the test2D array, by calling fillArray_2D(test2D) method. ▪ Task3: Finds and displays sum of each row and each column of the 2D array., by calling SumRowsColumns() method. ▪ Task4: Displays row(s) which contain(s) repeated elements in 2D array, by calling repeatedElementsRow() method.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY