Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that creates and returns a one-dimensional array containing all

ID: 3537444 • Letter: W

Question

Write a program that creates and returns a one-dimensional array containing all the elements in a 10 X 12 twodimensional array. Store the values in a row major format. You will populate the random number in two-dimensional

array with a range between 1 and 100. Display both the two-dimensional and the one-dimensional array.

In this program, you will create 4 static methods which are as follows.

static void FillTwoDimArray( int[ , ] twoDArray)

static void DisplayTwoDimArray( int[ , ] twoDArray)

static void StoreValues(int[ , ] twoDArray, int [ ] oneDArray)

static void DisplayOneDimArray(int[ ] oneDArray

Explanation / Answer

using System; public class ArrayConvert { public static void Main() { int[,] twoDArray = new int[10,12]; int[] int[10*12]; FillTwoDimArray(twoDArray); DisplayTwoDimArray(twoDArray); StoreValues(twoDArray,oneDArray); DisplayOneDimArray(oneDArray); } static void FillTwoDimArray( int[ , ] twoDArray) { Random rnd = new Random(); for(int i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote