Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed can someone help with this question, can you give insight , ideas how to write this .. thx

0 votes
asked Jan 20, 2018 by anonymous
closed Jan 24, 2018

Instructions:

1.       Create a two-dimensional array of size M x N to store integer values (use #define M 10 and N 5 to start, use M and N instead of hard-coding the array size to improve scalability). You should be able to modify the value of M and N and your code should automatically be scaled to work with the new value [to be tested later!].

2.       Initialize the array with 0's. Print the array (consider a PrintArray function).

3.       Populate the array with random numbers between 1 and 100. Print the array.

4.       Sort the array in ascending order using Bubble Sort (or any related variant), then print it.

5.       Use Linear Search to find if a number n is found in the array, where n is an integer between 1 and 100 entered by the user.

6.       [BONUS] Apply a single LEFT shift operation to the array. (LEFT shift means move every element one position to the LEFT; the first element becomes the last one, and the first element in each row moves up to become the last element in the previous row. 

7.       You can create an interactive menu for this program to: Initialize the array, randomly populate the array, sort, search, left-shift, printArray and quit. 

REQUIREMENTS:

·       Use a function called PrintArray2D() to print the array. The function takes the integer array and its size as parameters and has a void return. Design and document this function while keeping in mind maximum scalability and portability when it comes to reusingthis function.

·       Use functions like: InitializeArray2D(value),PopulateRandomValues2D()Sort2D()LinearSearch2D() andLeftShift2D() for each of the problem parts. In each case, the function accepts the array as a parameter along with any additional parameters you find necessary

closed with the note: no need
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...