Menu

Please Write C Program Part Lab Ll Writing Methods Work 1d Arrays Expect Know Create Array Q43882280

Please write a C#program

For this part of the lab, you’ll bewriting methods to work with 1D arrays. We will expect you to knowhow to create an array, and store and retrieve information fromthem.

  1. Continue working in the same project and “Program.cs” file.
    • You will be generating random numbers, but the classRandom is part of the standard library (don’t need anyadditional using statements).
    • You should consider developing the methods for this projectincrementally.

  1. In Main, use an initializer list create an array ofintegers called nums holding the following values: 1, 4,13, 43, -25, 17, 22, -37, 29.

  1. Write a method, called findLargest, that returns thelargest value in the array and have the Main print theresult.

  1. Create an integer array of size 20, called data andwrite a method to fill the array with random integers from [-100,100].
    • Recall that Random’s Next(x, y) methodreturns a value from x to y-1. The upper bound is exclusive, inother words. Modify the values to fit the required ranges.

  1. Use the findLargest method you previously wrote toreturn the largest value in data for the Main toprint.

  1. Print the sum of the largest values from nums anddata.

  1. Print the contents of data.

Expert Answer


Answer to Please write a C# program For this part of the lab, you’ll be writing methods to work with 1D arrays. We will expect you…

OR